(self, iteration)
| 125 | self.model.load_state_dict(params) |
| 126 | |
| 127 | def load_params(self, iteration): |
| 128 | cache_file = system_configs.snapshot_file.format(iteration) |
| 129 | print("loading model from {}".format(cache_file)) |
| 130 | with open(cache_file, "rb") as f: |
| 131 | params = torch.load(f) |
| 132 | self.model.load_state_dict(params) |
| 133 | |
| 134 | def save_params(self, iteration): |
| 135 | cache_file = system_configs.snapshot_file.format(iteration) |