edgetpu-ssdlite-mobiledet-retrain icon indicating copy to clipboard operation
edgetpu-ssdlite-mobiledet-retrain copied to clipboard

learning_rate probblem

Open lucaSartore opened this issue 3 years ago • 2 comments

hi the project is cool but for lower loss i suggest to use a "cosine total steps" similar to the total steps, for example if you are doing 30k steps you should add this code

pipeline.train_config.optimizer.momentum_optimizer.learning_rate.cosine_decay_learning_rate.warmup_steps=1000 pipeline.train_config.optimizer.momentum_optimizer.learning_rate.cosine_decay_learning_rate.total_steps=29000

lucaSartore avatar Apr 13 '21 17:04 lucaSartore

@lucaSartore MRs are welcome!! :) FYI: I'd love to have a drop of explanation or some reference I can read about on this

Namburger avatar Apr 13 '21 20:04 Namburger

the learning rate is a value that decide how much edit the value of your neural network, if the learning rate is high you will train your neural network quicker but less precise, if is low you are going to get a precise neural network but in a lot of time ( this is not 100% correct, check this for more informations: https://www.jeremyjordan.me/nn-learning-rate/). in order to get a good result in a decent amount of time you need to decrease the learning rate while you advance with steps. the "cosine decay learning_rate.total_steps=29000" value decide how many steps the learning rate need for pass from the initial value (0.8 in your case) to 0. if you set 10k steps you need to set the learning rate for reaching 0 just before the turning ending. by default this value is set to 400k that is too high if you train it for only 10-30k steps. you can check the learning rate in tensorboard as shown in the picture (with a total learning rate steps of 5k)

Screenshot (847)

lucaSartore avatar Apr 23 '21 07:04 lucaSartore