├── test ├── test_helper.exs └── neural_net │ ├── connection_test.exs │ ├── neuron_test.exs │ └── layer_test.exs ├── .gitignore ├── mix.lock ├── doc ├── fonts │ ├── icomoon.eot │ ├── icomoon.ttf │ ├── icomoon.woff │ └── icomoon.svg ├── index.html ├── dist │ ├── sidebar_items.js │ ├── app.css │ └── app.js ├── 404.html ├── extra-api-reference.html ├── Mix.Tasks.Neural.html ├── NeuralNet.Connection.html └── NeuralNet.Neuron.html ├── README.md ├── lib ├── neural_net │ ├── connection.ex │ ├── neuron.ex │ └── layer.ex └── mix │ └── tasks │ └── neural.ex ├── mix.exs └── config └── config.exs /test/test_helper.exs: -------------------------------------------------------------------------------- 1 | ExUnit.start() 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /_build 2 | /cover 3 | /deps 4 | erl_crash.dump 5 | *.ez 6 | -------------------------------------------------------------------------------- /mix.lock: -------------------------------------------------------------------------------- 1 | %{"earmark": {:hex, :earmark, "0.1.19"}, 2 | "ex_doc": {:hex, :ex_doc, "0.10.0"}} 3 | -------------------------------------------------------------------------------- /doc/fonts/icomoon.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kblake/neural-net-elixir-v1/HEAD/doc/fonts/icomoon.eot -------------------------------------------------------------------------------- /doc/fonts/icomoon.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kblake/neural-net-elixir-v1/HEAD/doc/fonts/icomoon.ttf -------------------------------------------------------------------------------- /doc/fonts/icomoon.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kblake/neural-net-elixir-v1/HEAD/doc/fonts/icomoon.woff -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NeuralNet 2 | 3 | **Neuron interactions** 4 | 5 | This is a very basic foundation for a neural network. It supports neuron connections. It is a WIP. 6 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Neural Net v0.0.1 – Documentation 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /lib/neural_net/connection.ex: -------------------------------------------------------------------------------- 1 | defmodule NeuralNet.Connection do 2 | @doc """ 3 | Represent a connection used by neurons 4 | 5 | iex> connection = %NeuralNet.Connection{} 6 | ...> connection.weight 7 | 0.5 8 | """ 9 | defstruct source: %{}, target: %{}, weight: 0.5 10 | 11 | 12 | def connection_for(source, target) do 13 | {:ok, %NeuralNet.Connection{source: source, target: target}} 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /doc/dist/sidebar_items.js: -------------------------------------------------------------------------------- 1 | sidebarNodes={"exceptions":[],"extras":[{"id":"extra-api-reference","title":"API Reference","headers":[]}],"modules":[{"id":"Mix.Tasks.Neural","title":"Mix.Tasks.Neural","functions":[{"id":"run/1","anchor":"run/1"}]},{"id":"NeuralNet.Connection","title":"NeuralNet.Connection","functions":[{"id":"__struct__/0","anchor":"__struct__/0"}]},{"id":"NeuralNet.Neuron","title":"NeuralNet.Neuron","functions":[{"id":"activate/2","anchor":"activate/2"},{"id":"activation_function/1","anchor":"activation_function/1"},{"id":"connect/2","anchor":"connect/2"}]}],"protocols":[]} -------------------------------------------------------------------------------- /mix.exs: -------------------------------------------------------------------------------- 1 | defmodule NeuralNet.Mixfile do 2 | use Mix.Project 3 | 4 | def project do 5 | [app: :neural_net, 6 | version: "0.0.1", 7 | elixir: "~> 1.1", 8 | name: "Neural Net", 9 | source_url: "https://github.com/kblake/neural-net-elixir", 10 | build_embedded: Mix.env == :prod, 11 | start_permanent: Mix.env == :prod, 12 | deps: deps] 13 | end 14 | 15 | # Configuration for the OTP application 16 | # 17 | # Type "mix help compile.app" for more information 18 | def application do 19 | [applications: [:logger]] 20 | end 21 | 22 | # Dependencies can be Hex packages: 23 | # 24 | # {:mydep, "~> 0.3.0"} 25 | # 26 | # Or git/path repositories: 27 | # 28 | # {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"} 29 | # 30 | # Type "mix help deps" for more examples and options 31 | defp deps do 32 | [ 33 | {:earmark, "~> 0.1", only: :dev}, 34 | {:ex_doc, "~> 0.10", only: :dev} 35 | ] 36 | end 37 | end 38 | -------------------------------------------------------------------------------- /test/neural_net/connection_test.exs: -------------------------------------------------------------------------------- 1 | defmodule NeuralNet.ConnectionTest do 2 | use ExUnit.Case, async: true 3 | doctest NeuralNet.Connection 4 | 5 | test "has default values" do 6 | connection = %NeuralNet.Connection{} 7 | assert connection.source == %{} 8 | assert connection.target == %{} 9 | assert connection.weight == 0.5 10 | end 11 | 12 | test "assign neurons to source and target" do 13 | neuronA = %NeuralNet.Neuron{input: 10} 14 | neuronB = %NeuralNet.Neuron{input: 5} 15 | connection = %NeuralNet.Connection{source: neuronA, target: neuronB} 16 | assert connection.source == neuronA 17 | assert connection.target == neuronB 18 | end 19 | 20 | test "create a connection for two neurons" do 21 | neuronA = %NeuralNet.Neuron{input: 10} 22 | neuronB = %NeuralNet.Neuron{input: 5} 23 | {:ok, connection} = NeuralNet.Connection.connection_for(neuronA, neuronB) 24 | assert connection.source == neuronA 25 | assert connection.target == neuronB 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /lib/mix/tasks/neural.ex: -------------------------------------------------------------------------------- 1 | defmodule Mix.Tasks.Neural do 2 | use Mix.Task 3 | 4 | @shortdoc "Run the neural network app" 5 | 6 | def run(args) do 7 | #neuronA = %NeuralNet.Neuron{} 8 | #neuronB = %NeuralNet.Neuron{} 9 | 10 | #{:ok, neuronA, neuronB} = NeuralNet.Neuron.connect(neuronA, neuronB) 11 | 12 | #neuronA = NeuralNet.Neuron.activate(neuronA) 13 | #IO.puts neuronA.output 14 | 15 | #neuronB = NeuralNet.Neuron.activate(neuronB, 1) 16 | #IO.puts neuronB.output 17 | 18 | #layer = %NeuralNet.Layer{neurons: [%NeuralNet.Neuron{}, %NeuralNet.Neuron{}]} 19 | #IO.inspect layer.neurons 20 | 21 | #inputs = [1,1,1] 22 | #{:ok, layer} = NeuralNet.Layer.activate(layer, inputs) 23 | 24 | #IO.inspect layer.neurons 25 | 26 | #input_layer = %NeuralNet.Layer{neurons: [%NeuralNet.Neuron{}, %NeuralNet.Neuron{}]} 27 | #output_layer = %NeuralNet.Layer{neurons: [%NeuralNet.Neuron{}, %NeuralNet.Neuron{}]} 28 | 29 | #{:ok, input_layer, output_layer} = %NeuralNet.Layer.connect(input_layer, output_layer) 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /config/config.exs: -------------------------------------------------------------------------------- 1 | # This file is responsible for configuring your application 2 | # and its dependencies with the aid of the Mix.Config module. 3 | use Mix.Config 4 | 5 | # This configuration is loaded before any dependency and is restricted 6 | # to this project. If another project depends on this project, this 7 | # file won't be loaded nor affect the parent project. For this reason, 8 | # if you want to provide default values for your application for 9 | # 3rd-party users, it should be done in your "mix.exs" file. 10 | 11 | # You can configure for your application as: 12 | # 13 | # config :neural_net, key: :value 14 | # 15 | # And access this configuration in your application as: 16 | # 17 | # Application.get_env(:neural_net, :key) 18 | # 19 | # Or configure a 3rd-party app: 20 | # 21 | # config :logger, level: :info 22 | # 23 | 24 | # It is also possible to import configuration files, relative to this 25 | # directory. For example, you can emulate configuration per environment 26 | # by uncommenting the line below and defining dev.exs, test.exs and such. 27 | # Configuration from the imported file will override the ones defined 28 | # here (which is why it is important to import them last). 29 | # 30 | # import_config "#{Mix.env}.exs" 31 | -------------------------------------------------------------------------------- /test/neural_net/neuron_test.exs: -------------------------------------------------------------------------------- 1 | defmodule NeuralNet.NeuronTest do 2 | use ExUnit.Case, async: true 3 | doctest NeuralNet.Neuron 4 | 5 | test "has default values" do 6 | neuron = %NeuralNet.Neuron{} 7 | assert neuron.input == 0 8 | assert neuron.output == 0 9 | assert neuron.incoming == [] 10 | assert neuron.outgoing == [] 11 | end 12 | 13 | test ".activation_function" do 14 | assert NeuralNet.Neuron.activation_function(1) == 0.7310585786300049 15 | end 16 | 17 | test ".activate with specified value" do 18 | neuron = NeuralNet.Neuron.activate(%NeuralNet.Neuron{}, 1) 19 | assert neuron.output == 0.7310585786300049 20 | end 21 | 22 | test ".activate with no incoming connections" do 23 | neuron = NeuralNet.Neuron.activate(%NeuralNet.Neuron{}) 24 | assert neuron.output == 0.5 25 | end 26 | 27 | test ".activate with incoming connections" do 28 | neuron = %NeuralNet.Neuron{ 29 | incoming: [ 30 | %NeuralNet.Connection{source: %NeuralNet.Neuron{output: 2}}, 31 | %NeuralNet.Connection{source: %NeuralNet.Neuron{output: 5}} 32 | ] 33 | } 34 | neuron = NeuralNet.Neuron.activate(neuron) 35 | assert neuron.output == 0.9706877692486436 36 | end 37 | 38 | test ".connect" do 39 | neuronA = %NeuralNet.Neuron{ outgoing: [%NeuralNet.Connection{}] } 40 | neuronB = %NeuralNet.Neuron{ incoming: [%NeuralNet.Connection{}] } 41 | 42 | {:ok, neuronA, neuronB} = NeuralNet.Neuron.connect(neuronA, neuronB) 43 | 44 | assert length(neuronA.outgoing) == 2 45 | assert length(neuronB.incoming) == 2 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /lib/neural_net/neuron.ex: -------------------------------------------------------------------------------- 1 | defmodule NeuralNet.Neuron do 2 | alias NeuralNet.Neuron, as: Neuron 3 | alias NeuralNet.Connection, as: Connection 4 | 5 | defstruct input: 0, output: 0, incoming: [], outgoing: [] 6 | 7 | @doc """ 8 | Sigmoid function. See more at: https://en.wikipedia.org/wiki/Sigmoid_function 9 | 10 | ## Example 11 | 12 | iex> NeuralNet.Neuron.activation_function(1) 13 | 0.7310585786300049 14 | """ 15 | def activation_function(input) do 16 | 1 / (1 + :math.exp(-input)) 17 | end 18 | 19 | defp sumf do 20 | fn(connection, sum) -> 21 | sum + connection.source.output * connection.weight 22 | end 23 | end 24 | 25 | @doc """ 26 | Activate a neuron 27 | 28 | ## Activate with specified value 29 | iex> neuron = NeuralNet.Neuron.activate(%NeuralNet.Neuron{}, 1) 30 | ...> neuron.output 31 | 0.7310585786300049 32 | 33 | ## Activate with no incoming connections 34 | iex> neuron = NeuralNet.Neuron.activate(%NeuralNet.Neuron{}) 35 | ...> neuron.output 36 | 0.5 37 | 38 | ## Activate with incoming connections 39 | iex> neuron = %NeuralNet.Neuron{ incoming: [ %NeuralNet.Connection{source: %NeuralNet.Neuron{output: 6}} ] } 40 | ...> neuron = NeuralNet.Neuron.activate(neuron) 41 | ...> neuron.output 42 | 0.9525741268224334 43 | """ 44 | def activate(neuron, value \\ nil) do 45 | input = value || Enum.reduce(neuron.incoming, 0, sumf) 46 | %Neuron{neuron | output: activation_function(input)} 47 | end 48 | 49 | @doc """ 50 | Connect two neurons 51 | 52 | ## Example 53 | 54 | iex> neuronA = %NeuralNet.Neuron{ outgoing: [%NeuralNet.Connection{}] } 55 | ...> neuronB = %NeuralNet.Neuron{ incoming: [%NeuralNet.Connection{}] } 56 | ...> {:ok, neuronA, neuronB} = NeuralNet.Neuron.connect(neuronA, neuronB) 57 | ...> length(neuronA.outgoing) 58 | 2 59 | iex> length(neuronB.incoming) 60 | 2 61 | """ 62 | def connect(source, target) do 63 | {:ok, connection} = Connection.connection_for(source, target) 64 | source = %Neuron{source | outgoing: source.outgoing ++ [connection]} 65 | target = %Neuron{target | incoming: target.incoming ++ [connection]} 66 | {:ok, source, target} 67 | end 68 | end 69 | -------------------------------------------------------------------------------- /doc/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 404 – Neural Net v0.0.1 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 19 | 57 | 58 |
59 |
60 | 61 | 62 |

Page not found

63 | 64 |

Sorry, but the page you were trying to get to, does not exist. You 65 | may want to try searching this site using the sidebar or using our 66 | API Reference page to find what 67 | you were looking for.

68 | 69 | 81 |
82 |
83 |
84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /test/neural_net/layer_test.exs: -------------------------------------------------------------------------------- 1 | defmodule NeuralNet.LayerTest do 2 | use ExUnit.Case, async: true 3 | doctest NeuralNet.Layer 4 | 5 | test "defaults layer" do 6 | NeuralNet.Layer.start_link(:input_layer) 7 | assert NeuralNet.Layer.neurons(:input_layer) == [] 8 | end 9 | 10 | test "layer initialized with neurons" do 11 | neurons = [%NeuralNet.Neuron{input: 1}, %NeuralNet.Neuron{input: 2}] 12 | NeuralNet.Layer.start_link(:input_layer, neurons) 13 | assert NeuralNet.Layer.neurons(:input_layer) == neurons 14 | end 15 | 16 | test "add neurons to layer" do 17 | neurons = [%NeuralNet.Neuron{input: 1}, %NeuralNet.Neuron{input: 2}] 18 | NeuralNet.Layer.start_link(:input_layer) 19 | NeuralNet.Layer.add_neurons(:input_layer, neurons) 20 | assert NeuralNet.Layer.neurons(:input_layer) == neurons 21 | end 22 | 23 | test "clear neurons from layer" do 24 | neurons = [%NeuralNet.Neuron{input: 1}, %NeuralNet.Neuron{input: 2}] 25 | NeuralNet.Layer.start_link(:input_layer, neurons) 26 | NeuralNet.Layer.clear_neurons(:input_layer) 27 | assert NeuralNet.Layer.neurons(:input_layer) == [] 28 | end 29 | 30 | test "activate when values are nil" do 31 | neurons = [%NeuralNet.Neuron{input: 1}, %NeuralNet.Neuron{input: 2}] 32 | NeuralNet.Layer.start_link(:input_layer, neurons) 33 | Enum.each NeuralNet.Layer.activate(:input_layer), fn neuron -> 34 | assert neuron.output == 0.5 35 | end 36 | end 37 | 38 | test "activate with values" do 39 | neurons = [%NeuralNet.Neuron{input: 1}, %NeuralNet.Neuron{input: 2}] 40 | NeuralNet.Layer.start_link(:input_layer, neurons) 41 | Enum.each NeuralNet.Layer.activate(:input_layer, [1,2]), fn neuron -> 42 | assert neuron.output >= 0.0 && neuron.output <= 1.0 43 | end 44 | end 45 | 46 | test "input and output layers are connected" do 47 | input_neurons = [%NeuralNet.Neuron{input: 1}, %NeuralNet.Neuron{input: 2}] 48 | NeuralNet.Layer.start_link(:input_layer, input_neurons) 49 | output_neurons = [%NeuralNet.Neuron{input: 3}, %NeuralNet.Neuron{input: 4}, %NeuralNet.Neuron{input: 5}] 50 | NeuralNet.Layer.start_link(:output_layer, output_neurons) 51 | 52 | {:ok, input_layer_neurons, output_layer_neurons} = NeuralNet.Layer.connect(:input_layer, :output_layer) 53 | 54 | Enum.each input_layer_neurons, fn(neuron) -> 55 | assert length(neuron.outgoing) == length(output_neurons) 56 | assert length(neuron.incoming) == 0 57 | target_neurons = Enum.map neuron.outgoing, fn(connection) -> connection.target end 58 | assert target_neurons == output_neurons 59 | end 60 | 61 | Enum.each output_layer_neurons, fn(neuron) -> 62 | assert length(neuron.incoming) == length(input_neurons) 63 | assert length(neuron.outgoing) == 0 64 | source_neurons = Enum.map neuron.incoming, fn(connection) -> connection.source end 65 | assert source_neurons == input_neurons 66 | end 67 | end 68 | end 69 | 70 | -------------------------------------------------------------------------------- /doc/extra-api-reference.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | API Reference – Neural Net v0.0.1 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 19 | 57 | 58 |
59 |
60 | 61 |

API Reference

62 | 63 | 70 | 71 | 72 |
73 |

Modules

74 |
75 |
76 | 77 | 78 |
79 |
80 | 81 | 82 |
83 |
84 | 85 | 86 |
87 | 88 |
89 |
90 | 91 | 92 | 93 | 94 | 95 | 107 |
108 |
109 |
110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /lib/neural_net/layer.ex: -------------------------------------------------------------------------------- 1 | defmodule NeuralNet.Layer do 2 | def start_link(layer_name, neurons \\ []) do 3 | Agent.start_link(fn -> neurons end, name: layer_name) 4 | end 5 | 6 | def neurons(layer_name) do 7 | Agent.get(layer_name, (&(&1))) 8 | end 9 | 10 | def add_neurons(layer_name, neurons) do 11 | Agent.update(layer_name, &(&1 ++ neurons)) 12 | end 13 | 14 | def clear_neurons(layer_name) do 15 | Agent.update(layer_name, &(&1 -- &1)) 16 | end 17 | 18 | defp set_neurons(layer_name, neurons) do 19 | clear_neurons(layer_name) 20 | add_neurons(layer_name, neurons) 21 | end 22 | 23 | def activate(layer_name, values \\ nil) do 24 | values = values || [] 25 | 26 | Agent.update(layer_name, fn neurons -> 27 | neurons 28 | |> Stream.with_index 29 | |> Enum.map(fn(tuple) -> 30 | {neuron, index} = tuple 31 | NeuralNet.Neuron.activate(neuron, Enum.at(values, index)) 32 | end) 33 | end) 34 | 35 | neurons(layer_name) 36 | end 37 | 38 | def connect(input_layer_name, output_layer_name) do 39 | Agent.start_link(fn -> [] end, name: :source_neurons) 40 | Agent.start_link(fn -> [] end, name: :target_neurons) 41 | 42 | # TODO: refactor this? 43 | Enum.each NeuralNet.Layer.neurons(input_layer_name), fn(source) -> 44 | Enum.each NeuralNet.Layer.neurons(output_layer_name), fn(target) -> 45 | {:ok, s, t} = NeuralNet.Neuron.connect(source, target) 46 | add_neurons(:source_neurons, [s]) 47 | end 48 | end 49 | 50 | Enum.each NeuralNet.Layer.neurons(output_layer_name), fn(target) -> 51 | Enum.each NeuralNet.Layer.neurons(input_layer_name), fn(source) -> 52 | {:ok, s, t} = NeuralNet.Neuron.connect(source, target) 53 | add_neurons(:target_neurons, [t]) 54 | end 55 | end 56 | 57 | input_layer_neurons = build_input_layer_neurons_with_connections(input_layer_name, output_layer_name) 58 | output_layer_neurons = build_output_layer_neurons_with_connections(input_layer_name, output_layer_name) 59 | 60 | set_neurons(input_layer_name, input_layer_neurons) 61 | set_neurons(output_layer_name, output_layer_neurons) 62 | 63 | stop_agent(:source_neurons) 64 | stop_agent(:target_neurons) 65 | 66 | {:ok, input_layer_neurons, output_layer_neurons} 67 | end 68 | 69 | defp stop_agent(agent_name) do 70 | Process.exit(Process.whereis(agent_name), :shutdown) 71 | end 72 | 73 | 74 | # TODO: simplify this method 75 | defp build_input_layer_neurons_with_connections(input_layer_name, output_layer_name) do 76 | # group neurons by source 77 | input_layer_outgoing_connections = 78 | Enum.chunk(neurons(:source_neurons), length(NeuralNet.Layer.neurons(output_layer_name))) 79 | |> Enum.map(fn(neurons) -> # collect the connections for each source neuron 80 | Enum.map neurons, fn neuron -> 81 | List.first neuron.outgoing # list of connections for a source neuron 82 | end 83 | end) 84 | 85 | # reduce each source neuron with collected outgoing connections 86 | NeuralNet.Layer.neurons(input_layer_name) 87 | |> Stream.with_index 88 | |> Enum.map(fn tuple -> 89 | {neuron, index} = tuple 90 | %NeuralNet.Neuron{neuron | outgoing: Enum.at(input_layer_outgoing_connections, index)} 91 | end) 92 | end 93 | 94 | 95 | # TODO: simplify this method 96 | # TODO: consilaate this method 97 | defp build_output_layer_neurons_with_connections(input_layer_name, output_layer_name) do 98 | # group neurons by source 99 | output_layer_incoming_connections = 100 | Enum.chunk(neurons(:target_neurons), length(NeuralNet.Layer.neurons(input_layer_name))) 101 | |> Enum.map(fn(neurons) -> # collect the connections for each target neuron 102 | Enum.map neurons, fn neuron -> 103 | List.first neuron.incoming # list of connections for a target neuron 104 | end 105 | end) 106 | 107 | # reduce each source neuron with collected outgoing connections 108 | NeuralNet.Layer.neurons(output_layer_name) 109 | |> Stream.with_index 110 | |> Enum.map(fn tuple -> 111 | {neuron, index} = tuple 112 | %NeuralNet.Neuron{neuron | incoming: Enum.at(output_layer_incoming_connections, index)} 113 | end) 114 | end 115 | end 116 | -------------------------------------------------------------------------------- /doc/fonts/icomoon.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by IcoMoon 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /doc/Mix.Tasks.Neural.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Mix.Tasks.Neural – Neural Net v0.0.1 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 19 | 57 | 58 |
59 |
60 | 61 | 62 |

63 | Mix.Tasks.Neural 64 | 65 | 66 | 67 | 68 | 69 | 70 |

71 | 72 | 73 | 74 | 75 |
76 |

77 | 78 | 79 | 80 | Summary 81 |

82 | 83 | 84 | 85 |
86 |

87 | Functions 88 |

89 |
90 |
91 | run(args) 92 |
93 | 94 |

Callback implementation for c:Mix.Task.run/1

95 |
96 | 97 |
98 | 99 |
100 | 101 | 102 | 103 | 104 | 105 | 106 |
107 | 108 | 109 | 110 | 111 | 112 |
113 |

114 | 115 | 116 | 117 | Functions 118 |

119 |
120 |
121 | 122 | 123 | 124 | run(args) 125 | 126 | 127 | 128 | 129 | 130 |
131 | 132 |
133 |

Callback implementation for c:Mix.Task.run/1.

134 | 135 |
136 |
137 | 138 |
139 | 140 | 141 | 142 | 143 | 144 | 156 |
157 |
158 |
159 | 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /doc/NeuralNet.Connection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | NeuralNet.Connection – Neural Net v0.0.1 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 19 | 57 | 58 |
59 |
60 | 61 | 62 |

63 | NeuralNet.Connection 64 | 65 | 66 | 67 | 68 | 69 | 70 |

71 | 72 | 73 | 74 | 75 |
76 |

77 | 78 | 79 | 80 | Summary 81 |

82 | 83 | 84 | 85 |
86 |

87 | Functions 88 |

89 |
90 |
91 | __struct__() 92 |
93 | 94 |

Represent a connection used by neurons

95 |
96 | 97 |
98 | 99 |
100 | 101 | 102 | 103 | 104 | 105 | 106 |
107 | 108 | 109 | 110 | 111 | 112 |
113 |

114 | 115 | 116 | 117 | Functions 118 |

119 |
120 |
121 | 122 | 123 | 124 | __struct__() 125 | 126 | 127 | 128 | 129 | 130 |
131 | 132 |
133 |

Represent a connection used by neurons

134 |
iex> connection = %NeuralNet.Connection{}
135 | ...> connection.weight
136 | 0.5
137 | 138 |
139 |
140 | 141 |
142 | 143 | 144 | 145 | 146 | 147 | 159 |
160 |
161 |
162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /doc/NeuralNet.Neuron.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | NeuralNet.Neuron – Neural Net v0.0.1 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 19 | 57 | 58 |
59 |
60 | 61 | 62 |

63 | NeuralNet.Neuron 64 | 65 | 66 | 67 | 68 | 69 | 70 |

71 | 72 | 73 | 74 | 75 |
76 |

77 | 78 | 79 | 80 | Summary 81 |

82 | 83 | 84 | 85 |
86 |

87 | Functions 88 |

89 |
90 | 93 | 94 |

Active a neuron

95 |
96 | 97 |
98 |
99 | 102 | 103 |

Sigmoid function. See more at: https://en.wikipedia.org/wiki/Sigmoid_function

104 |
105 | 106 |
107 |
108 | 111 | 112 |

Connect two neurons

113 |
114 | 115 |
116 | 117 |
118 | 119 | 120 | 121 | 122 | 123 | 124 |
125 | 126 | 127 | 128 | 129 | 130 |
131 |

132 | 133 | 134 | 135 | Functions 136 |

137 |
138 |
139 | 140 | 141 | 142 | activate(neuron, value \\ nil) 143 | 144 | 145 | 146 | 147 | 148 |
149 | 150 |
151 |

Active a neuron

152 |

Activate with specified value

153 |
iex> neuron = NeuralNet.Neuron.activate(%NeuralNet.Neuron{}, 1)
154 | ...> neuron.output
155 | 0.7310585786300049
156 |

Activate with no incoming connections

157 |
iex> neuron = NeuralNet.Neuron.activate(%NeuralNet.Neuron{})
158 | ...> neuron.output
159 | 0.5
160 |

Activate with incoming connections

161 |
iex> neuron = %NeuralNet.Neuron{ incoming: [ %NeuralNet.Connection{source: %NeuralNet.Neuron{output: 6}} ] }
162 | ...> neuron = NeuralNet.Neuron.activate(neuron)
163 | ...> neuron.output
164 | 0.9525741268224334
165 | 166 |
167 |
168 |
169 |
170 | 171 | 172 | 173 | activation_function(input) 174 | 175 | 176 | 177 | 178 | 179 |
180 | 181 |
182 |

Sigmoid function. See more at: https://en.wikipedia.org/wiki/Sigmoid_function

183 |

Example

184 |
iex> NeuralNet.Neuron.activation_function(1)
185 | 0.7310585786300049
186 | 187 |
188 |
189 |
190 |
191 | 192 | 193 | 194 | connect(source, target) 195 | 196 | 197 | 198 | 199 | 200 |
201 | 202 |
203 |

Connect two neurons

204 |

Example

205 |
iex> neuronA = %NeuralNet.Neuron{ outgoing: [%NeuralNet.Connection{}] }
206 | ...> neuronB = %NeuralNet.Neuron{ incoming: [%NeuralNet.Connection{}] }
207 | ...> {:ok, neuronA, neuronB} = NeuralNet.Neuron.connect(neuronA, neuronB)
208 | ...> length(neuronA.outgoing)
209 | 2
210 | iex> length(neuronB.incoming)
211 | 2
212 | 213 |
214 |
215 | 216 |
217 | 218 | 219 | 220 | 221 | 222 | 234 |
235 |
236 |
237 | 238 | 239 | 240 | 241 | -------------------------------------------------------------------------------- /doc/dist/app.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Lato:400,300,700,900|Merriweather:300italic,300,700,700italic|Inconsolata:400,700);.hljs,article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}img,legend{border:0}.sidebar a,.sidebar-toggle{transition:color .3s ease-in-out}.sidebar .sidebar-search .sidebar-searchInput:focus,.sidebar .sidebar-search .sidebar-searchInput:hover,.sidebar-toggle:active,.sidebar-toggle:focus,.sidebar-toggle:hover,a:active,a:hover{outline:0}.results ul,.sidebar ul{list-style:none}.hljs-comment{color:#8e908c}.css .hljs-class,.css .hljs-id,.css .hljs-pseudo,.hljs-attribute,.hljs-regexp,.hljs-tag,.hljs-variable,.html .hljs-doctype,.ruby .hljs-constant,.xml .hljs-doctype,.xml .hljs-pi,.xml .hljs-tag .hljs-title{color:#c82829}.hljs-built_in,.hljs-constant,.hljs-literal,.hljs-number,.hljs-params,.hljs-pragma,.hljs-preprocessor{color:#f5871f}.css .hljs-rule .hljs-attribute,.ruby .hljs-class .hljs-title{color:#eab700}.hljs-header,.hljs-inheritance,.hljs-name,.hljs-string,.hljs-value,.ruby .hljs-symbol,.xml .hljs-cdata{color:#718c00}.css .hljs-hexcolor,.hljs-title{color:#3e999f}.coffeescript .hljs-title,.hljs-function,.javascript .hljs-title,.perl .hljs-sub,.python .hljs-decorator,.python .hljs-title,.ruby .hljs-function .hljs-title,.ruby .hljs-title .hljs-keyword{color:#4271ae}.hljs-keyword,.javascript .hljs-function{color:#8959a8}.hljs{overflow-x:auto;background:#fff;color:#4d4d4c;padding:.5em;-webkit-text-size-adjust:none}legend,td,th{padding:0}.coffeescript .javascript,.javascript .xml,.tex .hljs-formula,.xml .css,.xml .hljs-cdata,.xml .javascript,.xml .vbscript{opacity:.5}/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}abbr[title]{border-bottom:1px dotted}b,optgroup,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}.main,body,html{overflow:hidden}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}.content,.main,.sidebar,body,html{height:100%}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}table{border-collapse:collapse;border-spacing:0}@font-face{font-family:icomoon;src:url(../fonts/icomoon.eot?h5z89e);src:url(../fonts/icomoon.eot?#iefixh5z89e) format('embedded-opentype'),url(../fonts/icomoon.ttf?h5z89e) format('truetype'),url(../fonts/icomoon.woff?h5z89e) format('woff'),url(../fonts/icomoon.svg?h5z89e#icomoon) format('svg');font-weight:400;font-style:normal}.icon-elem,[class*=" icon-"],[class^=icon-]{font-family:icomoon;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.sidebar,body{font-family:Lato,sans-serif}.icon-link:before{content:"\e005"}.icon-search:before{content:"\e036"}.icon-cross:before{content:"\e117"}.icon-menu:before{content:"\e120"}.icon-angle-right:before{content:"\f105"}.icon-code:before{content:"\f121"}body,html{box-sizing:border-box;width:100%}body{margin:0;font-size:16px;line-height:1.6875em}*,:after,:before{box-sizing:inherit}.main{display:-webkit-flex;display:-ms-flexbox;display:-ms-flex;display:flex}.sidebar,body.sidebar-closed .sidebar{display:none}.sidebar{-webkit-flex:0 1 300px;-moz-flex:0 1 300px;-ms-flex:0 1 300px;flex:0 1 300px;-ms-flex-positive:0;-ms-flex-negative:1;-ms-flex-preferred-size:300px;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-box-direction:normal;-moz-box-direction:normal;min-height:0;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;position:absolute;z-index:999}.content{-webkit-flex:1 1 .01%;-moz-flex:1 1 .01%;-ms-flex:1 1 .01%;flex:1 1 .01%;-ms-flex-positive:1;-ms-flex-negative:1;-ms-flex-preferred-size:.01%;overflow-y:auto;-webkit-overflow-scrolling:touch}.content-inner{max-width:949px;margin:0 auto;padding:3px 60px}@media screen and (max-width:768px){.content-inner{padding:27px 20px 27px 40px}}body.sidebar-closed .sidebar-toggle{display:block}.sidebar-toggle{position:fixed;z-index:99;left:18px;top:8px;background-color:transparent;border:none;padding:0;font-size:16px}.sidebar-toggle:hover{color:#e1e1e1}@media screen and (min-width:768px){.sidebar-toggle{display:none}}.sidebar{font-size:14px;line-height:18px;background:#373f52;color:#d5dae6;overflow:hidden}.sidebar .sidebar-toggle{display:block;left:275px;color:#e1e1e1}.sidebar .sidebar-toggle:hover{color:#fff}.sidebar ul li{margin:0;padding:0 10px}.sidebar a{color:#d5dae6;text-decoration:none}.sidebar a:hover{color:#fff}.sidebar .sidebar-projectLink{margin:23px 30px 0}.sidebar .sidebar-projectDetails{display:inline-block;text-align:right;vertical-align:top;margin-top:6px}.sidebar .sidebar-projectImage{display:inline-block;max-width:64px;max-height:64px;margin-left:15px;vertical-align:bottom}.sidebar .sidebar-projectName{font-weight:700;font-size:24px;line-height:30px;color:#fff;margin:0;padding:0;max-width:155px}.sidebar .sidebar-projectVersion{margin:0;padding:0;font-weight:300;font-size:16px;line-height:20px;color:#fff}.sidebar .sidebar-listNav{padding:0 30px}.sidebar .sidebar-listNav li,.sidebar .sidebar-listNav li a{text-transform:uppercase;font-weight:300;font-size:13px}.sidebar .sidebar-listNav li{padding-left:17px;border-left:3px solid transparent;transition:all .3s linear;line-height:27px}.sidebar .sidebar-listNav li.selected,.sidebar .sidebar-listNav li.selected a,.sidebar .sidebar-listNav li:hover,.sidebar .sidebar-listNav li:hover a{border-color:#9768d1;color:#fff}.sidebar .sidebar-search{margin:23px 30px 18px;display:-webkit-flex;display:-ms-flexbox;display:-ms-flex;display:flex}.sidebar .sidebar-search i.icon-search{font-size:14px;color:#d5dae6}.sidebar #full-list li.clicked>a,.sidebar #full-list ul li.active a{color:#fff}.sidebar .sidebar-search .sidebar-searchInput{background-color:transparent;border:none;border-radius:0;border-bottom:1px solid #959595;margin-left:5px}.sidebar #full-list{margin:4px 0 0 30px;padding:0 20px;overflow-y:auto;-webkit-overflow-scrolling:touch;-webkit-flex:1 1 .01%;-moz-flex:1 1 .01%;-ms-flex:1 1 .01%;flex:1 1 .01%;-ms-flex-positive:1;-ms-flex-negative:1;-ms-flex-preferred-size:.01%}.sidebar #full-list ul{margin:0 20px;padding:9px 0 18px}.sidebar #full-list ul li{font-weight:300;line-height:18px}.sidebar #full-list ul li ul{display:none;padding:9px 0}.sidebar #full-list ul li ul li{border-left:1px solid #959595;padding:0 10px}.sidebar #full-list ul li ul li.active:before{font-family:icomoon;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\f105";margin-left:-10px;font-size:16px;margin-right:5px}.sidebar #full-list ul li.active{border-left:none}.sidebar #full-list ul li.active ul{display:block}.sidebar #full-list li{padding:0;line-height:27px}.sidebar #full-list li.collapsed ul{display:none}@media screen and (min-width:768px){.sidebar{position:relative;display:-webkit-flex;display:-ms-flexbox;display:-ms-flex;display:flex}}@media screen and (max-height:500px){.sidebar{overflow-y:auto}.sidebar #full-list{overflow:visible}}.content-inner{font-family:Merriweather,serif;font-size:1em;line-height:1.6875em}.content-inner h1,.content-inner h2,.content-inner h3,.content-inner h4,.content-inner h5,.content-inner h6{font-family:Lato,sans-serif;font-weight:800;line-height:1.5em;word-wrap:break-word}.content-inner h1{font-size:2em;margin:1em 0 .5em}.content-inner h1.section-heading{margin:1.5em 0 .5em}.content-inner h1 small{font-weight:300}.content-inner h1 a.view-source{font-size:1.2rem}.content-inner h2{font-size:1.625em;margin:1em 0 .5em;font-weight:400}.content-inner h3{font-size:1.375em;margin:1em 0 .5em;font-weight:600}.content-inner a{color:#000;text-decoration:none;text-shadow:.03em 0 #fff,-.03em 0 #fff,0 .03em #fff,0 -.03em #fff,.06em 0 #fff,-.06em 0 #fff,.09em 0 #fff,-.09em 0 #fff,.12em 0 #fff,-.12em 0 #fff,.15em 0 #fff,-.15em 0 #fff;background-image:linear-gradient(#fff,#fff),linear-gradient(#fff,#fff),linear-gradient(#000,#000);background-size:.05em 1px,.05em 1px,1px 1px;background-repeat:no-repeat,no-repeat,repeat-x;background-position:0 90%,100% 90%,0 90%}.content-inner a:selection{text-shadow:.03em 0 #b4d5fe,-.03em 0 #b4d5fe,0 .03em #b4d5fe,0 -.03em #b4d5fe,.06em 0 #b4d5fe,-.06em 0 #b4d5fe,.09em 0 #b4d5fe,-.09em 0 #b4d5fe,.12em 0 #b4d5fe,-.12em 0 #b4d5fe,.15em 0 #b4d5fe,-.15em 0 #b4d5fe;background:#b4d5fe}.content-inner a:-moz-selection{text-shadow:.03em 0 #b4d5fe,-.03em 0 #b4d5fe,0 .03em #b4d5fe,0 -.03em #b4d5fe,.06em 0 #b4d5fe,-.06em 0 #b4d5fe,.09em 0 #b4d5fe,-.09em 0 #b4d5fe,.12em 0 #b4d5fe,-.12em 0 #b4d5fe,.15em 0 #b4d5fe,-.15em 0 #b4d5fe;background:#b4d5fe}.content-inner a *,.content-inner a :after,.content-inner a :before,.content-inner a:after,.content-inner a:before{text-shadow:none}.content-inner a:visited{color:#000}.content-inner ul li{line-height:1.5em}.content-inner a.view-source{float:right;color:#959595;background:0 0;border:none;text-shadow:none;transition:color .3s ease-in-out}.content-inner a.view-source:hover{color:#373f52}.content-inner blockquote{font-style:italic;margin:.5em 0;padding:.25em 1.5em;border-left:3px solid #e1e1e1;display:inline-block}.content-inner blockquote :first-child{padding-top:0;margin-top:0}.content-inner blockquote :last-child{padding-bottom:0;margin-bottom:0}.content-inner table{margin:2em 0}.content-inner th{text-align:left;font-family:Lato,sans-serif;text-transform:uppercase;font-weight:600;padding-bottom:.5em}.content-inner tr{border-bottom:1px solid #d5dae6;vertical-align:bottom;height:2.5em}.content-inner .summary .summary-row .summary-signature a,.content-inner .summary h2 a{background:0 0;border:none;text-shadow:none}.content-inner td,.content-inner th{padding-left:1em;line-height:2em}.content-inner h1.section-heading:hover a.hover-link{opacity:1;text-decoration:none}.content-inner h1.section-heading a.hover-link{transition:opacity .3s ease-in-out;display:inline-block;opacity:0;padding:.3em .6em .6em;line-height:1em;margin-left:-2.7em;background:0 0;border:none;text-shadow:none;font-size:16px;vertical-align:middle}.content-inner .summary h2{font-weight:600}.content-inner .summary .summary-row .summary-signature{font-family:Inconsolata,Menlo,Courier,monospace;font-weight:600}.content-inner .summary .summary-row .summary-synopsis{font-family:Merriweather,serif;font-style:italic;padding:0 .5em;margin:0 0 .5em}.content-inner .detail-header,.content-inner code{font-family:Inconsolata,Menlo,Courier,monospace}.content-inner .summary .summary-row .summary-synopsis p{margin:0;padding:0}.content-inner .detail-header{margin:2.5em 0 .5em;padding:.5em 1em;background:#f7f7f7;border-left:3px solid #9768d1;font-size:1em;position:relative}.content-inner .detail-header .signature{font-size:1rem;font-weight:600}.content-inner .detail-header:hover a.detail-link{opacity:1;text-decoration:none}.content-inner .detail-header a.detail-link{transition:opacity .3s ease-in-out;position:absolute;top:0;left:0;display:block;opacity:0;padding:.6em;line-height:1.5em;margin-left:-2.5em;background:0 0;border:none;text-shadow:none}.content-inner .specs .specs-list pre code,.content-inner .types .types-list .type-detail pre code{padding:0 .5em;border:none}.content-inner .specs .specs-list{margin:0 0 2em}.content-inner .specs .specs-list pre{margin:.5em 0}.content-inner .types .types-list .type-detail{margin-bottom:2em}.content-inner .types .types-list .type-detail pre{margin:.5em 0}.content-inner .types .types-list .type-detail .typespec-doc{padding:0 1.5em}.content-inner a.no-underline,.content-inner code a{color:#9768d1;text-shadow:none;background-image:none}.content-inner a.no-underline:active,.content-inner a.no-underline:focus,.content-inner a.no-underline:hover,.content-inner a.no-underline:visited,.content-inner code a:active,.content-inner code a:focus,.content-inner code a:hover,.content-inner code a:visited{color:#9768d1}.content-inner code{font-size:15px;font-style:normal;line-height:24px;font-weight:400;background-color:#f7f9fc;border:1px solid #e1e1e1;vertical-align:middle;border-radius:2px;padding:0 .5em}.content-inner pre{margin:1.5em 0}.content-inner pre.spec{margin:0}.content-inner pre.spec code{padding:0}.content-inner pre code.hljs{white-space:inherit;padding:1em 1.5em;background-color:#f7f9fc}.content-inner .footer{margin:4em auto 1em;text-align:center;font-style:italic;font-size:14px;color:#959595}.content-inner .footer .line{display:inline-block}.content-inner .footer a{color:#959595;text-decoration:none;text-shadow:.03em 0 #fff,-.03em 0 #fff,0 .03em #fff,0 -.03em #fff,.06em 0 #fff,-.06em 0 #fff,.09em 0 #fff,-.09em 0 #fff,.12em 0 #fff,-.12em 0 #fff,.15em 0 #fff,-.15em 0 #fff;background-image:linear-gradient(#fff,#fff),linear-gradient(#fff,#fff),linear-gradient(#959595,#959595);background-size:.05em 1px,.05em 1px,1px 1px;background-repeat:no-repeat,no-repeat,repeat-x;background-position:0 90%,100% 90%,0 90%}.content-inner .footer a:selection{text-shadow:.03em 0 #b4d5fe,-.03em 0 #b4d5fe,0 .03em #b4d5fe,0 -.03em #b4d5fe,.06em 0 #b4d5fe,-.06em 0 #b4d5fe,.09em 0 #b4d5fe,-.09em 0 #b4d5fe,.12em 0 #b4d5fe,-.12em 0 #b4d5fe,.15em 0 #b4d5fe,-.15em 0 #b4d5fe;background:#b4d5fe}.content-inner .footer a:-moz-selection{text-shadow:.03em 0 #b4d5fe,-.03em 0 #b4d5fe,0 .03em #b4d5fe,0 -.03em #b4d5fe,.06em 0 #b4d5fe,-.06em 0 #b4d5fe,.09em 0 #b4d5fe,-.09em 0 #b4d5fe,.12em 0 #b4d5fe,-.12em 0 #b4d5fe,.15em 0 #b4d5fe,-.15em 0 #b4d5fe;background:#b4d5fe}.results .result-id a,a.close-search{text-shadow:none;background-image:none;transition:color .3s ease-in-out}.content-inner .footer a *,.content-inner .footer a :after,.content-inner .footer a :before,.content-inner .footer a:after,.content-inner .footer a:before{text-shadow:none}.content-inner .footer a:visited{color:#959595}a.close-search{margin-top:-3em;display:block;float:right}a.close-search:active,a.close-search:focus,a.close-search:visited{color:#000}a.close-search:hover{color:#9768d1}.results .result-id{font-size:1.2em}.results .result-id a:active,.results .result-id a:focus,.results .result-id a:visited{color:#000}.results .result-id a:hover{color:#9768d1}.results .result-elem em,.results .result-id em{font-style:normal;color:#9768d1}.results ul{margin:0;padding:0}@media print{#sidebar{display:none}} -------------------------------------------------------------------------------- /doc/dist/app.js: -------------------------------------------------------------------------------- 1 | !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(typeof e[t]){case"function":break;case"object":e[t]=function(t){var n=t.slice(1),r=e[t[0]];return function(e,t,i){r.apply(this,[e,t,i].concat(n))}}(e[t]);break;default:e[t]=e[e[t]]}return e}([function(e,t,n){"use strict";var r=n(1)["default"],i=n(2),a=r(i),o=n(3),s=r(o),l=n(4),c=n(95);window.$=a["default"],a["default"](function(){s["default"].configure({tabReplace:" ",languages:[]}),c.initialize(),l.initialize(),s["default"].initHighlighting()})},function(e,t){"use strict";t["default"]=function(e){return e&&e.__esModule?e:{"default":e}},t.__esModule=!0},function(e,t,n){var r,i;!function(t,n){"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,function(n,a){function o(e){var t="length"in e&&e.length,n=re.type(e);return"function"===n||re.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function s(e,t,n){if(re.isFunction(t))return re.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return re.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(fe.test(t))return re.filter(t,e,n);t=re.filter(t,e)}return re.grep(e,function(e){return V.call(t,e)>=0!==n})}function l(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function c(e){var t=ye[e]={};return re.each(e.match(ve)||[],function(e,n){t[n]=!0}),t}function u(){te.removeEventListener("DOMContentLoaded",u,!1),n.removeEventListener("load",u,!1),re.ready()}function f(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=re.expando+f.uid++}function d(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ke,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:Ee.test(n)?re.parseJSON(n):n}catch(i){}we.set(e,t,n)}else n=void 0;return n}function p(){return!0}function h(){return!1}function g(){try{return te.activeElement}catch(e){}}function m(e,t){return re.nodeName(e,"table")&&re.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function v(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function y(e){var t=Be.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function b(e,t){for(var n=0,r=e.length;r>n;n++)_e.set(e[n],"globalEval",!t||_e.get(t[n],"globalEval"))}function x(e,t){var n,r,i,a,o,s,l,c;if(1===t.nodeType){if(_e.hasData(e)&&(a=_e.access(e),o=_e.set(t,a),c=a.events)){delete o.handle,o.events={};for(i in c)for(n=0,r=c[i].length;r>n;n++)re.event.add(t,i,c[i][n])}we.hasData(e)&&(s=we.access(e),l=re.extend({},s),we.set(t,l))}}function _(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return void 0===t||t&&re.nodeName(e,t)?re.merge([e],n):n}function w(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Se.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function E(e,t){var r,i=re(t.createElement(e)).appendTo(t.body),a=n.getDefaultComputedStyle&&(r=n.getDefaultComputedStyle(i[0]))?r.display:re.css(i[0],"display");return i.detach(),a}function k(e){var t=te,n=We[e];return n||(n=E(e,t),"none"!==n&&n||(ze=(ze||re("