What happens if I do this:
hNetModel = Model()
for trainBatch, trainLabels in hTrainLoader:
<Train the Model by a Function>
modelEvaluationMetric = hNetModel(Validation)
if(modelEvaluationMetric < bestModelMetric):
hBestModel = hNetModel
Namely I run the model trhough the optimization and if its performance are the best so far I use hBestModel = hNetModel
.
At the end I save the dictionary of hBestModel
.
Does it makes sense or is it just another reference to the same net always?