mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-11 12:31:23 +08:00
F.cross_entropy(y_hat, y)(y_hat, y) typo. (#137)
This seems to be a typo. Throws TypeError: 'Tensor' object is not callable.
This commit is contained in:
@@ -50,13 +50,13 @@ class CoolModel(pl.LightningModule):
|
|||||||
# REQUIRED
|
# REQUIRED
|
||||||
x, y = batch
|
x, y = batch
|
||||||
y_hat = self.forward(x)
|
y_hat = self.forward(x)
|
||||||
return {'loss': F.cross_entropy(y_hat, y)(y_hat, y)}
|
return {'loss': F.cross_entropy(y_hat, y)}
|
||||||
|
|
||||||
def validation_step(self, batch, batch_nb):
|
def validation_step(self, batch, batch_nb):
|
||||||
# OPTIONAL
|
# OPTIONAL
|
||||||
x, y = batch
|
x, y = batch
|
||||||
y_hat = self.forward(x)
|
y_hat = self.forward(x)
|
||||||
return {'val_loss': F.cross_entropy(y_hat, y)(y_hat, y)}
|
return {'val_loss': F.cross_entropy(y_hat, y)}
|
||||||
|
|
||||||
def validation_end(self, outputs):
|
def validation_end(self, outputs):
|
||||||
# OPTIONAL
|
# OPTIONAL
|
||||||
|
|||||||
Reference in New Issue
Block a user