• Stars
    star
    115
  • Rank 305,916 (Top 7 %)
  • Language
    Elixir
  • Created almost 9 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Neural network written in Elixir

Neural Network

A neural network made up of layers of neurons connected to each other to form a relationship allowing it to learn.

After cloning:

$ mix deps.get
$ mix compile

Usage

Run the trainer and see the network learn using OR GATE data

$ mix learn or

You should see output like this:

OR gate learning *********************************************
Epoch: 0   Error: 0.0978034950879825143
Epoch: 1000   Error: 0.0177645755625382047
Epoch: 2000   Error: 0.0065019384961036274
Epoch: 3000   Error: 0.0032527653252166144
Epoch: 4000   Error: 0.0019254900093371497
Epoch: 5000   Error: 0.0012646710040632755
Epoch: 6000   Error: 0.0008910514800247452
Epoch: 7000   Error: 0.0006602873040322224
Epoch: 8000   Error: 0.0005081961006147329
Epoch: 9000   Error: 0.0004028528701046857
Epoch: 9999   Error: 0.0003270377487769315
Epoch: 10000   Error: 0.0003269728572615501
**************************************************************

Run the trainer and see the network learn using IRIS FLOWER GATE data

$ mix learn iris_flower

You should see output like this:

IRIS_FLOWER gate learning *********************************************
Epoch: 0   Error: 0.0164425788515711185
Epoch: 1000   Error: 0.027344153205250403
Epoch: 2000   Error: 0.0265533867778006451
Epoch: 3000   Error: 0.0266624718167679346
Epoch: 4000   Error: 0.0268164947904966262
Epoch: 5000   Error: 0.026857493502782933
Epoch: 6000   Error: 0.026794287038049043
Epoch: 7000   Error: 0.0266556275054049274
Epoch: 8000   Error: 0.0264642981722699525
Epoch: 9000   Error: 0.0262360305030914023
Epoch: 9999   Error: 0.025981881761432242
Epoch: 10000   Error: 0.025981617016649871
**************************************************************

Valid options are: or, and, xor, nand, iris_flower

Run tests

$ mix test

Run Console

alias NeuralNetwork.{DataFactory, Network, LossFunction, Layer}
{:ok, network_pid} = Network.start_link([2, 1], %{activation: :relu})
data = DataFactory.gate_for("or")
Network.fit(network_pid, data, %{epochs: 10_000, log_freqs: 1000})
Network.predict(network_pid, [1,1])

Huge props

Installation

Available in Hex, the package can be installed as:

  1. Add neural_network to your list of dependencies in mix.exs:

    def deps do [{:neural_network, "~> 0.1.4"}] end

  2. Ensure neural_network is started before your application:

    def application do [applications: [:neural_network]] end

More Repositories

1

functional-programming

Organize material to teach functional programming using Elixir
Elixir
363
star
2

simple-supervision

Very simple supervision setup that protects against divide by zero
Elixir
41
star
3

opentok

Ruby gem for opentok api
Ruby
26
star
4

learning-ruby

Code examples from my years of teaching Ruby at Spokane Community College
Ruby
18
star
5

neural-net-elixir-v1

Neural network written in Elixir
Elixir
14
star
6

neural-networks

Building neural networks. Using Ruby and Elixir
Ruby
13
star
7

erlang-chat-demo

Wildfireapp chat demo
Erlang
6
star
8

beginning-erlang-for-ruby-developers

Ruby
6
star
9

mongoid-starter-app

Rails Mongoid Starter App
Ruby
4
star
10

Code-Kata-Exercise

Spokane/CDA Ruby User Group - Code Kata Exercise on Oct 7th, 2009
Ruby
4
star
11

pivotaltracker-widget

Manage dashboard for PivotalTracker.com
Ruby
3
star
12

neural_network

Neural network written in Ruby
Ruby
3
star
13

phoenix-is-not-your-application

A super duper simple example of "Phoenix is not your application"
Elixir
3
star
14

my-pivotal-wip

A user Sinatra app visualizing Work In Progress for a project in Pivotal Tracker
Ruby
3
star
15

team-roster-app

AngularJS code used in the tutorial I wrote for the Software Developer's Journal
HTML
3
star
16

highlinecc_intro_to_rails

Sample Rails app I created in a quick demonstration
Ruby
2
star
17

Learn-Ruby-by-Testing-First

Inspired by http://testfirst.org and http://rubykoans.com
Ruby
2
star
18

introduction-to-erlang-presentation

Showoff Presentation I gave at the Silicon Valley Web Builders Group
Ruby
2
star
19

twittercompare

Compare mutual followers between two Twitter accounts
Ruby
2
star
20

twitter-followers-histogram

Histogram showing the amount of followers your followers have
Ruby
1
star
21

Ruby-Chops

Web site to showcase iphone/ruby/rails screencasts
Ruby
1
star
22

attributes_sort

Sorting a collection of objects by one or more attributes
Ruby
1
star