MCPcopy
hub / github.com/Turing-Project/WriteGPT / update

Method update

LanguageNetwork/BERT/models/stats.py:69–81  ·  view source on GitHub ↗

Update statistics by suming values with another `Statistics` object Args: stat: another statistic object update_n_src_words(bool): whether to update (sum) `n_src_words` or not

(self, stat, update_n_src_words=False)

Source from the content-addressed store, hash-verified

67 return our_stats
68
69 def update(self, stat, update_n_src_words=False):
70 """
71 Update statistics by suming values with another `Statistics` object
72
73 Args:
74 stat: another statistic object
75 update_n_src_words(bool): whether to update (sum) `n_src_words`
76 or not
77
78 """
79 self.loss += stat.loss
80
81 self.n_docs += stat.n_docs
82
83 def xent(self):
84 """ compute cross entropy """

Callers 11

validateMethod · 0.95
testMethod · 0.95
predictMethod · 0.95
hashhexFunction · 0.45
all_gather_stats_listMethod · 0.45
build_tf_to_pytorch_mapFunction · 0.45
count_fileMethod · 0.45
count_sentsMethod · 0.45
http_getFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected