I have loaded a model in Torch and I would like to fine-tune it. For now I'd like to retrain the last 2 layers of the network (though in the future I may want to add layers). How can I do this? I have been looking for tutorials, but I haven't found what I am looking for. Any tips?
相关问题
- Convolutional Neural Network seems to be randomly
- Training with dropout
- How to convert a list of tensors into a torch::Ten
- How to implement RBF activation function in Keras?
- When to use what type of padding for convolution l
相关文章
- RuntimeError: Expected object of backend CUDA but
- Why does different batch-sizes give different accu
- How do you change the dimension of your input pict
- torch / lua: retrieving n-best subset from Tensor
- Keras Functional model giving high validation accu
- Using Conv2DTranspose to output the double of its
- How to choose the number of filters in each Convol
- Implement Causal CNN in Keras for multivariate tim
I don't know if I understood what you are asking for. If you want to leave the net as it was except for the 2 layers you want to train (or fine-tune) you have to stop the backpropagation on the ones you don't want to train, like this:
Now only the layers outside of this loop will upgrade their parameters. If you want to add new layers just call
model:insert(module, position)
, you can have a look here Torch containersIf that was not what you were looking for, please elaborate more on the question.