pytorch-lightning

Difference between forward and train_step in Pytorch Lightning?

Difference between forward and train_step in Pytorch Lightning? Question: I have a transfer learning Resnet set up in Pytorch Lightning. the structure is borrowed from this wandb tutorial https://wandb.ai/wandb/wandb-lightning/reports/Image-Classification-using-PyTorch-Lightning–VmlldzoyODk1NzY and from looking at the documentation https://pytorch-lightning.readthedocs.io/en/latest/common/lightning_module.html I am confused about the difference between the def forward () and the def training_step() methods. Initially in the …

Total answers: 3

How to dump confusion matrix using TensorBoard logger in pytorch-lightning?

How to dump confusion matrix using TensorBoard logger in pytorch-lightning? Question: The official doc only states >>> from pytorch_lightning.metrics import ConfusionMatrix >>> target = torch.tensor([1, 1, 0, 0]) >>> preds = torch.tensor([0, 1, 0, 0]) >>> confmat = ConfusionMatrix(num_classes=2) >>> confmat(preds, target) This doesn’t show how to use the metric with the framework. My attempt …

Total answers: 3