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)
| 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 """ |
no outgoing calls
no test coverage detected