File tree 1 file changed +3
-3
lines changed 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 715
715
" EPOCHS = 15\n " ,
716
716
" \n " ,
717
717
" for epoch in range(1, EPOCHS+1):\n " ,
718
- " running_loss = .0\n " ,
719
- " running_corrects = .0\n " ,
720
718
" best_acc = .0\n " ,
721
719
" print(f\"\\ nEpoch {epoch}/{EPOCHS}\\ n{'='*25}\" )\n " ,
722
720
" for phase in ['train', 'val']:\n " ,
721
+ " running_loss = .0\n " ,
722
+ " running_corrects = .0\n " ,
723
723
" if phase == 'train': model.train()\n " ,
724
724
" if phase == 'val': model.eval()\n " ,
725
725
" for inputs, labels in loaders[phase]:\n " ,
742
742
" epoch_acc = running_corrects.double() / dataset_sizes[phase]\n " ,
743
743
" if phase == 'train': scheduler.step()\n " ,
744
744
" if phase == 'val' and epoch_acc > best_acc:\n " ,
745
- " best_corrects = epoch_acc\n " ,
745
+ " best_acc = epoch_acc\n " ,
746
746
" best_model_weights = deepcopy(model.state_dict())\n " ,
747
747
" print(f\" Loss ({phase}): {epoch_loss}, Acc ({phase}): {epoch_acc}\" )"
748
748
]
You can’t perform that action at this time.
0 commit comments