MCPcopy Create free account
hub / github.com/Kaggle/docker-python / training_step

Method training_step

tests/test_pytorch_lightning.py:43–48  ·  view source on GitHub ↗
(self, batch, batch_idx)

Source from the content-addressed store, hash-verified

41 def training_step(self, batch, batch_idx):
42 x, y = batch
43 y_hat = self(x)
44 loss = F.cross_entropy(y_hat, y)
45 self.log('train_loss', loss)
46 return loss
47
48 def validation_step(self, batch, batch_idx):
49 x, y = batch
50 y_hat = self(x)
51 loss = F.cross_entropy(y_hat, y)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected