-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReduceLrOnPlateau implementation issues #8927
Comments
nvm i found out the issue and corrected my code.
it works now i am dumb sorry. |
hi, i have been trying to implement a reducelronplateau scheduler which will allow tracking of loss history, and automatically update the learning rate whenever a loss plateau is detected.
i have made some changes to do the same, firstly i made a struct in darknet.h and initialised it in darknet.c, this struct defined as "reduce_lr_params" is initialised by the name "param_list" as below:
The code first checks if the current iteration (param_list.curr_iter) matches the batch_num, this is done because there are multiple places where the function is called within the same batch/iteration to print the learning rate.
if the param_list.curr_iter same as batch_num, we return the old learning rate as no adjustment is needed there.
If the first condition is not met (i.e., param_list.curr_iter != batch_num), it proceeds to print debug information and continue with updating the learning rate as per the defined policy.
now when i run the code, my logs are printed as below:
as seen above from the logs, plateau is detected at iteration 6, and the debug statement prints the value that the function returns, which is the reduce learning rate. but in the very next print statement (from detector.c by default) shows the learning rate as the old value.
somewhere in the code, the learning rate value is getting overwritten and i am not sure where as this is my first time working with C and programming in general.
this could be a feature request but as i had already tried implementing it and failed, i am putting it here.
please help this noob.
The text was updated successfully, but these errors were encountered: