(
self,
trainer: Trainer,
pl_module: LightningModule,
batch: Any,
batch_idx: int,
dataloader_idx: int = 0,
)
| 84 | return fig |
| 85 | |
| 86 | def on_validation_batch_start( |
| 87 | self, |
| 88 | trainer: Trainer, |
| 89 | pl_module: LightningModule, |
| 90 | batch: Any, |
| 91 | batch_idx: int, |
| 92 | dataloader_idx: int = 0, |
| 93 | ) -> None: |
| 94 | if batch_idx == 0: |
| 95 | output = trainer.model(batch["input"]) |
| 96 | fig = self.plot_spectrum(batch, output) |
| 97 | for logger in trainer.loggers: |
| 98 | # Check WandbLogger and Enabled |
| 99 | if issubclass(type(logger), WandbLogger) and not issubclass( |
| 100 | type(logger.experiment), wandb.sdk.lib.disabled.RunDisabled |
| 101 | ): |
| 102 | logger: WandbLogger = logger |
| 103 | logger.experiment.log({f"plot/{pl_module.current_epoch:03d}": fig}) |
nothing calls this directly
no test coverage detected