0

I wish to repeat a series of image classification experiments by reusing a CNN with the same CNN with identical hyperparameters especially initializations. So, if I save a model after I have instantiated it and before I train it, does that also save the initializations so I then reload it later and train with a different data set and labels, does it start this new model with the same hyperparameters and initializations as the first model I trained with the first data set/classification labels? I am currently using fastai which is, of course, a library/set of API's, built on Pythorch but I think that everyone would be helped with a more general explanation that covers all CNN's using any library.

I expect an answer that says, "after this point in the workflow creating a CNN, the model is initialized and if you save it at this point, you can reload it later and use the same hyperparameters and initializations in your next model."

  • This is very well documented in the fastai docs, have a look at these: 1. https://docs.fast.ai/tutorial.inference.html#A-regression-example 2. https://docs.fast.ai/basic_train.html#Deploying-your-model – pushpendra pratap Jun 08 '19 at 18:34

1 Answers1

1

you can save the learner as soon it is created.

Example:

learn = cnn_learner(data,models.resnet34,metrics=error_rate)
learn.save('init')

later on:

learn.load('init)
Tree
  • 29,135
  • 24
  • 78
  • 98