integration as HP metrics #1102
Ilykuleshov
started this conversation in
Ideas
Replies: 1 comment
-
Currently, PyTorch Lightning doesn’t add TorchMetrics metrics as HP metrics to TensorBoard by default. The existing HP metrics support can indeed be confusing and limited. from torchmetrics import Accuracy
import pytorch_lightning as pl
class LitModel(pl.LightningModule):
def __init__(self):
super().__init__()
self.accuracy = Accuracy()
def validation_step(self, batch, batch_idx):
x, y = batch
y_hat = self(x)
acc = self.accuracy(y_hat, y)
# Log accuracy as a hyperparameter metric
self.log('hp/val_accuracy', acc, prog_bar=True, logger=True) This way, your metrics will appear under the HP metrics section in TensorBoard. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to add the model's torchmetrics metrics as HP-metrics to tensorboard by default (or via a parameter)? Right now hp-metrics in pl are very inconvenient and confusing, to the point of being useless. This would deepen the pytorch lightning integration and make hp-metric a lot more usable and also add incentive to use torchmetrics.
Beta Was this translation helpful? Give feedback.
All reactions