mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-20 13:10:42 +08:00
added multiple outputs to LightningTestModel
This commit is contained in:
@@ -127,16 +127,16 @@ class LightningTestModel(LightningModule):
|
||||
val_acc = val_acc.unsqueeze(0)
|
||||
|
||||
# alternate possible outputs to test
|
||||
if self.trainer.batch_nb % 0 == 0:
|
||||
if self.trainer.batch_nb % 1 == 0:
|
||||
output = OrderedDict({
|
||||
'val_loss': loss_val,
|
||||
'val_acc': val_acc,
|
||||
})
|
||||
return output
|
||||
if self.trainer.batch_nb % 1 == 0:
|
||||
if self.trainer.batch_nb % 2 == 0:
|
||||
return val_acc
|
||||
|
||||
if self.trainer.batch_nb % 2 == 0:
|
||||
if self.trainer.batch_nb % 3 == 0:
|
||||
output = OrderedDict({
|
||||
'val_loss': loss_val,
|
||||
'val_acc': val_acc,
|
||||
|
||||
Reference in New Issue
Block a user