Skip to content

Instantly share code, notes, and snippets.

@cosmic-cortex
Created Oct 23, 2019
Embed
What would you like to do?
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