-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
adding tensorboard loss tracking for training and evaluation #1532
Conversation
Seems there are lots of whitespace differences that makes this PR difficult to review. Perhaps remove the whitespace changes you made and this might expedite the review process? |
Yes, sorry about that, it should be more clear now |
Thanks for this PR. There is a PR #1606 that adds a generic way to track loss that is also compatible with e.g. W&B. My plan is to add this generic framework first and then have classes / callbacks that can be used to track with tensorboard / W&B etc. |
Great, W&B is definitely better and easier, I couldn't use it because of the license, but if you are giving us access to the values to design any custom dashboard then it would be perfect. |
Contains an inherited class from SentenceTransformer called TBSentenceTransformer that allows llamaindex's SentenceTransformersFinetuneEngine to track and record loss while finetuning using tensorboard. Credit to this PR: UKPLab/sentence-transformers#1532 , by Ahmed Magdy https://github.com/Mogady
I saw multiple discussions on adding loss tracking and tensor-board integration, however no pull requests have been made in that direction. 1021, 510, 336 and recently I needed that also.
I added a loss tracking module for both training and evaluation.
For evaluation:
since the code allow for custom evaluators, a LossEvaluator class is added which allow for calculating the loss and writing to TFboard logs beside the CSV file.
For training:
.fit()
signature but not much, just adding a parametertensorboard_params: Dict[str, object] = {'log': True, 'steps': 1000, 'loss': True, 'lr': False, 'grad_hist': False, 'grad_stats': False}
for controlling it.I understand this is not general enough, and i tried to not change the code signature that much, but hopefully it can serve as a reference or a basis for a better integration in the next versions.