Hacker News new | ask | show | jobs
by klintcho 2448 days ago
What made me fall in love with PyTorch was also that the "neural network training process" is defined almost as it is in theory, in code in PyTorch

- loop through epochs

- loop through each batch

- run a forward pass for the batch ( model(batch) )

- calculate the loss for the batch ( criteria(y, yprim)

- compute the gradients/backprop ( loss.backward() )

- update the weights (optimizer.step())

This really enforced everything I learned and I think breaks down the problem. All this of course in addition to everything else already mentioned, and super convenient module/network building and definition.

1 comments

Yes! Exactly.