Elixir artificial intelligence library. (Extreemly early pre pre alpha!!!)
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
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'
-
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"
-
Run the server
docker-here -p 8888:8888 exlearn-jupyter
-
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"
-
Run an interactive shell
docker-here exlearn iex -S mix
-
Update dependencies
docker-here exlearn mix deps.get
-
Run tests
docker-here exlearn mix test
-
Run tests with coverage report
docker-here exlearn mix coveralls
-
Run dialyzer
docker-here exlearn mix dialyzer
This plugin is covered by the BSD license, see LICENSE for details.