BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.06k stars 18.7k forks source link

Allow pycaffe to update solver parameters, e.g., learning rate and momentum #2686

Open PiranjaF opened 9 years ago

PiranjaF commented 9 years ago

Many SGD schedules specify that the learning rate should be annealed when validation accuracy has somewhat converged. Similarly, momentum should be around 0.5 in the beginning (http://ufldl.stanford.edu/tutorial/supervised/OptimizationStochasticGradientDescent/) and then to 0.9 when learning is stabilized.

Can these parameters be changed during training from the Python interface? Having this as an option seems like an obvious enhancement.

samuelgoodell commented 9 years ago

I could really use this in my code as well.

shelhamer commented 9 years ago

This is certainly worth doing and only requires minor coding to make the hyperparams for SGDSolver mutable and exposed through boost::python.

As a hack this can be done by running the solver through gdb -- not that I'm really suggesting that.

talda commented 9 years ago

@shelhamer a much simpler hack would be to train with an initial set of parameters and than change the parameters and fine tune on each step of parameter change.

pgrossmann commented 9 years ago

@talda Would you mind sharing an example of how to change any of the hyperparameters (e.g., the learning rate) using PyCaffe? I tried inspecting the solver objects, but I couldn't find the variable that stores that parameter. Thank you!

ravi-june commented 8 years ago

For solution, see http://stackoverflow.com/questions/31823898/changing-the-solver-parameters-in-caffe-through-pycaffe

mitar commented 6 years ago

+1 on allowing one to change the learning rate and other parameters.

hala3 commented 5 years ago

i want to finetune a pretrained model which trained with pycaffe
are there any tutorial can help me please ??