Closed TyTorch closed 1 year ago
Thanks for the note. I am not sure why there is a .long()
call. Like you said, it should be a float.
Just fixed this.
For some reason, the ch12.py
script file had a
loss = loss_fn(pred.long(), y_batch)
instead of
loss = loss_fn(pred, y_batch.long())
The ch12.ipynb
file was ok.
The model created to perform regression on the iris dataset uses a softmax function as the activation function of its final layer. I am not able to call the long() function on its output. It does work when I uses float instead.
The following is the error log I get when copying and pasting the code into Google Collab