(chk_path, epoch, lr, optimizer, model_pos, min_loss)
| 44 | torch.manual_seed(seed) |
| 45 | |
| 46 | def save_checkpoint(chk_path, epoch, lr, optimizer, model_pos, min_loss): |
| 47 | print('Saving checkpoint to', chk_path) |
| 48 | torch.save({ |
| 49 | 'epoch': epoch + 1, |
| 50 | 'lr': lr, |
| 51 | 'optimizer': optimizer.state_dict(), |
| 52 | 'model_pos': model_pos.state_dict(), |
| 53 | 'min_loss' : min_loss |
| 54 | }, chk_path) |
| 55 | |
| 56 | def evaluate(args, model_pos, test_loader, datareader): |
| 57 | print('INFO: Testing') |