Skip to content
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

Add tensorboard callback #230

Open
sebffischer opened this issue Jun 14, 2024 · 0 comments
Open

Add tensorboard callback #230

sebffischer opened this issue Jun 14, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@sebffischer
Copy link
Sponsor Member

sebffischer commented Jun 14, 2024

The goal here is to add a callback that logs the training and the validation error (if the latter exists) and is then displayed in the browser via tensorboard. The R package for tensorboard can be found here: https://github.com/mlverse/tfevents.

For the first implementation, we can use the torch_callback helper function as defined here: https://mlr3torch.mlr-org.com/articles/callbacks.html

Once everything is working as expected, we can move away from this "syntactic sugar" and implemented it directly as an R6 Class has e.g. here: https://github.com/mlr-org/mlr3torch/blob/main/R/CallbackSetProgress.R. This is necessary to generate the proper documentation for the class.

The training and validation loss can be accessed via those two fields from the torch context:

self$last_scores_train = structure(list(), names = character(0))
self$last_scores_valid = structure(list(), names = character(0))

The validation loss is only present when a validation task is set, so we need to handle both cases.
Another open question is which configuration options we want for the callback.
We can also look a bit how it is implemented in keras: https://www.tensorflow.org/api_docs/python/tf/keras/callbacks/TensorBoard although we don't need to get the whole feature set, at least not in the first iteration.

@sebffischer sebffischer added the good first issue Good for newcomers label Jun 14, 2024
@sebffischer sebffischer added this to the 0.2 milestone Jun 14, 2024
@sebffischer sebffischer added the enhancement New feature or request label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants