(self, ma_model, current_model)
| 11 | self.step = 0 |
| 12 | |
| 13 | def update_model_average(self, ma_model, current_model): |
| 14 | for current_params, ma_params in zip(current_model.parameters(), ma_model.parameters()): |
| 15 | old_weight, up_weight = ma_params.data, current_params.data |
| 16 | ma_params.data = self.update_average(old_weight, up_weight) |
| 17 | |
| 18 | def update_average(self, old, new): |
| 19 | if old is None: |
no test coverage detected