Skip to content

Instantly share code, notes, and snippets.

@alstat
Last active March 8, 2018 10:50
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 alstat/edf68b86f174e2d67c8a5a11ef6af27a to your computer and use it in GitHub Desktop.
Save alstat/edf68b86f174e2d67c8a5a11ef6af27a to your computer and use it in GitHub Desktop.
using Flux: ADAM,
argmax,
Chain,
Dense,
params,
relu,
softmax
m = Chain(
Dense(32^2 * 3, 32 * 10, relu),
Dense(32 * 10, 100),
softmax
);
loss(x, y) = crossentropy(m(x), y);
accuracy(x, y) = mean(argmax(m(x)) .== argmax(y));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment