Skip to content

Instantly share code, notes, and snippets.

@cosmic-cortex
Created October 23, 2019 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosmic-cortex/6e4bed9566970aba8d3647e2106eaec9 to your computer and use it in GitHub Desktop.
Save cosmic-cortex/6e4bed9566970aba8d3647e2106eaec9 to your computer and use it in GitHub Desktop.
net = Net(layers=[Linear(2, 4), ReLU(), Linear(4, 2)],
loss=CrossEntropyLoss())
out = net(X)
loss = net.loss(out, Y_labels)
grad = net.backward()
net.update_weights(lr=0.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment