update logreg example
This commit is contained in:
parent
15b3ce1ada
commit
5c548fe1c4
@ -17,7 +17,7 @@ makedocs(modules=[Flux],
|
|||||||
"Backends" => "apis/backends.md",
|
"Backends" => "apis/backends.md",
|
||||||
"Storing Models" => "apis/storage.md"],
|
"Storing Models" => "apis/storage.md"],
|
||||||
"In Action" => [
|
"In Action" => [
|
||||||
"Logistic Regression" => "examples/logreg.md",
|
"Simple MNIST" => "examples/logreg.md",
|
||||||
"Char RNN" => "examples/char-rnn.md"],
|
"Char RNN" => "examples/char-rnn.md"],
|
||||||
"Contributing & Help" => "contributing.md",
|
"Contributing & Help" => "contributing.md",
|
||||||
"Internals" => "internals.md"])
|
"Internals" => "internals.md"])
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# Logistic Regression with MNIST
|
# Recognising MNIST Digits
|
||||||
|
|
||||||
This walkthrough example will take you through writing a multi-layer perceptron that classifies MNIST digits with high accuracy.
|
This walkthrough example will take you through writing a multi-layer perceptron that classifies MNIST digits with high accuracy.
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ m = Chain(
|
|||||||
Affine( 64), relu,
|
Affine( 64), relu,
|
||||||
Affine( 10), softmax)
|
Affine( 10), softmax)
|
||||||
|
|
||||||
model = tf(m)
|
model = mxnet(m) # Convert to MXNet
|
||||||
```
|
```
|
||||||
|
|
||||||
We can try this out on our data already:
|
We can try this out on our data already:
|
||||||
|
@ -10,13 +10,13 @@ m = Chain(
|
|||||||
Affine( 64), relu,
|
Affine( 64), relu,
|
||||||
Affine( 10), softmax)
|
Affine( 10), softmax)
|
||||||
|
|
||||||
# Convert to TensorFlow
|
# Convert to MXNet
|
||||||
model = tf(m)
|
model = mxnet(m)
|
||||||
|
|
||||||
# An example prediction pre-training
|
# An example prediction pre-training
|
||||||
model(data[1][1])
|
model(data[1][1])
|
||||||
|
|
||||||
@time Flux.train!(model, train, test, η = 1e-4)
|
Flux.train!(model, train, test, η = 1e-4)
|
||||||
|
|
||||||
# An example prediction post-training
|
# An example prediction post-training
|
||||||
model(data[1][1])
|
model(data[1][1])
|
||||||
|
Loading…
Reference in New Issue
Block a user