Code Monkey home page Code Monkey logo

exlearn's Introduction

ExLearn

Build Status Coverage Status

Elixir artificial intelligence library. (Extreemly early pre pre alpha!!!)

Example

alias ExLearn.NeuralNetwork, as: NN

structure_parameters = %{
  layers: %{
    input:   %{size: 2},
    hidden: [%{activity: :logistic, name: "First Hidden", size: 2}],
    output:  %{activity: :tanh,     name: "Output",       size: 1}
  },
  objective: :quadratic,
  random:    %{distribution: :uniform, range: {-1, 1}}
}

network = NN.initialize(structure_parameters)

training_data = [
  {[0, 0], [0]},
  {[0, 1], [0]},
  {[1, 0], [0]},
  {[1, 1], [1]}
]

configuration = %{
  batch_size:     2,
  data_size:      4,
  epochs:         1000,
  dropout:        0.5,
  learning_rate:  0.5,
  regularization: :L2
}

NN.feed(training_data, configuration, network)

ask_data = [[0, 0], [0, 1], [1, 0], [1, 1]]

result = NN.ask(ask_data, network)

IO.inspect result

Usage with Docker

Add the following aliases to ~/.bash_profile and source it:

alias docker-here='docker run --rm -it -u `id -u`:`id -g` -v "$PWD":/work -w /work'
alias docker-root-here='docker run --rm -it -v "$PWD":/work -w /work'

Jupyter Notebook

  1. Build the notebook container

    docker build                        \
      -t exlearn-jupyter                \
      --build-arg HOST_USER_UID=`id -u` \
      --build-arg HOST_USER_GID=`id -g` \
      -f docker/notebook/Dockerfile     \
      "$PWD"
    
    # OR the short version if you are user 1000:1000
    
    docker build -t exlearn-jupyter -f docker/notebook/Dockerfile "$PWD"
  2. Run the server

    docker-here -p 8888:8888 exlearn-jupyter

Development

  1. Build the project container

    docker build                        \
      -t exlearn                        \
      --build-arg HOST_USER_UID=`id -u` \
      --build-arg HOST_USER_GID=`id -g` \
      -f docker/project/Dockerfile      \
      "$PWD"
    
    # OR the short version if you are user 1000:1000
    
    docker build -t exlearn -f docker/project/Dockerfile "$PWD"
  2. Run an interactive shell

    docker-here exlearn iex -S mix
  3. Update dependencies

    docker-here exlearn mix deps.get
  4. Run tests

    docker-here exlearn mix test
  5. Run tests with coverage report

    docker-here exlearn mix coveralls
  6. Run dialyzer

    docker-here exlearn mix dialyzer

LICENSE

This plugin is covered by the BSD license, see LICENSE for details.

exlearn's People

Contributors

saftacatalinmihai avatar sdwolfz avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.