Packages

NeuralNet is an A.I. library that allows for the construction and training of complex recurrent neural networks. Architectures such as LSTM or GRU can be specified in under 20 lines of code. Any neural network that can be built with the NeuralNet DSL can be trainined with automatically implemente...

Current section

Files

Jump to
neural_net lib grum.ex
Raw

lib/grum.ex

defmodule GRUM do
@moduledoc "GRUM is home-made to GRU. It has a dedicated memory that can be set to any arbitrary size using `memory_size`."
@doc "Takes an argument map with the keys :input_ids, :output_ids, and :memory_size. The values for :input_ids and :output_ids should be a list of component/id names for the input and output vectors (respectively). The value for :memory_size should be an integer for the number of components in the memory vector."
use NeuralNet
def template(inp, out \\ uid()) do
memory = GRU.template(inp)
tanh [memory, inp], out
{memory, out}
end
defp define(args) do
{memory, _} = template(input, output)
def_vec(input, args.input_ids)
def_vec_by_size(memory, args.memory_size)
def_vec(output, args.output_ids)
end
end