-
Notifications
You must be signed in to change notification settings - Fork 398
let model do validate among a new recorded variable global_steps rather than epochs #566
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
Comments
Thanks for the suggestion. Maybe you could help me clarify some things. This is what I understood: You want to either 1) validate less frequently than once per epoch (e.g. validate only every 10th train epoch), or 2) more frequently, e.g. 10x per train epoch. Is that correct so far? Regarding 1), please have a look at #564. Maybe we can do something there to make that feature possible. Regarding 2), this sounds more difficult. E.g. we have the Regarding your tf code, I'm sorry but I don't understand what it's doing. Could you explain? What is the conceptual difference between epoch and step -- is a step a batch? |
yeah,step is a batch for each optimizer.step() If controllable validate frequency is a good feature , I think we can add a key such as global_step and make global_step +=1 in on_batch_end ,when a new epoch begin, make global_step = last epoch's global_step . Then in fit_loop, through a frequency parameters,decide to validate or not ,the default frequency can be (len(dataset)-1)//batch_size+1 which just validate each epoch.
This is a problem,I didn't think about it,in my code ,I drop the PrintLog Callback |
The number of training batches can already be calculated from the history: Regarding the option to trigger validation after a certain number of training batches, I find this a bit odd since sometimes this will trigger at the beginning of the epoch, sometimes at the end, sometimes inbetween (depending on the number of batches per epoch and the step size). Would it not make more sense to validate every N complete training epochs (with N>=1)? I believe that should be easy to implement with the changes in #564. |
A new feature may be sound like this
The default fit loop do validate each epoch,so if one want to do validate more steps or less steps,can only make train_split =None and implement a new callback.
So I wonder if this project can achieve such a function or callback class,I plan to implement a callback for my need and I‘m pleasured to contribute to this if needed
In many papers such like bert,they say optimized how many steps rather than how many epochs
In bert source code
The text was updated successfully, but these errors were encountered: