-
-
Save bararchy/3a0eb08ac6527c62cce7f8383c4a440a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mnist = SHAInet::Network.new | |
mnist.add_layer(:input, 784, :memory, :sigmoid) | |
mnist.add_layer(:hidden, 50, :memory, :sigmoid) | |
mnist.add_layer(:hidden, 10, :eraser, :sigmoid) | |
mnist.add_layer(:hidden, 10, :memory, :sigmoid) | |
mnist.add_layer(:hidden, 50, :memory, :sigmoid) | |
mnist.add_layer(:output, 10, :memory, :sigmoid) | |
# Input to first hidden | |
mnist.connect_ltl(mnist.input_layers.first, mnist.hidden_layers.first, :full) | |
# first hidden to [1] and [2] | |
mnist.connect_ltl(mnist.hidden_layers.first, mnist.hidden_layers[1], :full) | |
mnist.connect_ltl(mnist.hidden_layers.first, mnist.hidden_layers[2], :full) | |
# [1] and [2] to last hidden | |
mnist.connect_ltl(mnist.hidden_layers[1], mnist.hidden_layers.last, :full) | |
mnist.connect_ltl(mnist.hidden_layers[2], mnist.hidden_layers.last, :full) | |
# [0] & [3] to output | |
mnist.connect_ltl(mnist.hidden_layers[0], mnist.output_layers.first, :full) | |
mnist.connect_ltl(mnist.hidden_layers[3], mnist.output_layers.first, :full) | |
# ||=================================|| | |
# || ||=> [10:E] =|| v | |
# [784:M] => [50:M]=>|| || => [50:M] => [10:M] | |
# ||=> [10:M] =|| | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment