1027bfd4b8ff9482d877521a094657aecb0fe3ac,python/ray/tune/examples/mnist_pytorch_lightning.py,LightningMNISTClassifier,training_step,#LightningMNISTClassifier#Any#Any#,74
Before Change
accuracy = self.accuracy(logits, y)
logs = {"ptl/train_loss": loss, "ptl/train_accuracy": accuracy}
return {"loss": loss, "log": logs}
def validation_step(self, val_batch, batch_idx):
x, y = val_batch
logits = self.forward(x)
After Change
loss = self.cross_entropy_loss(logits, y)
accuracy = self.accuracy(logits, y)
self.log("ptl/train_loss", loss)
self.log("ptl/train_accuracy", accuracy)
return loss
def validation_step(self, val_batch, batch_idx):
x, y = val_batch
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: ray-project/ray
Commit Name: 1027bfd4b8ff9482d877521a094657aecb0fe3ac
Time: 2020-10-08
Author: amogkam@users.noreply.github.com
File Name: python/ray/tune/examples/mnist_pytorch_lightning.py
Class Name: LightningMNISTClassifier
Method Name: training_step
Project Name: ray-project/ray
Commit Name: 1027bfd4b8ff9482d877521a094657aecb0fe3ac
Time: 2020-10-08
Author: amogkam@users.noreply.github.com
File Name: python/ray/tune/examples/mnist_pytorch_lightning.py
Class Name: LightningMNISTClassifier
Method Name: validation_epoch_end
Project Name: ray-project/ray
Commit Name: 1027bfd4b8ff9482d877521a094657aecb0fe3ac
Time: 2020-10-08
Author: amogkam@users.noreply.github.com
File Name: python/ray/tune/examples/mnist_pytorch_lightning.py
Class Name: LightningMNISTClassifier
Method Name: training_step
Project Name: ray-project/ray
Commit Name: 1027bfd4b8ff9482d877521a094657aecb0fe3ac
Time: 2020-10-08
Author: amogkam@users.noreply.github.com
File Name: python/ray/tune/tests/test_integration_pytorch_lightning.py
Class Name: _MockModule
Method Name: validation_epoch_end