The code is written in moonscript (based on and complies to Lua) with LOVE support. The code is based on Welch Lab's youtube series.
The moonscript code is in the moon/
folder. The compiled lua code is in the lua/
folder.
NOTE: All the files in lua/
are deleted and re-created when building, so don't write code in there.
The NeuralNetwork
class consists of the following:
NeuralNetwork([topology])
- constructor. Creates a new neural network with the specified topologynetCost()
- calculates the cost of the whole neural network (wherennet.YHat
is the computed result andnnet.Y
is the desired one)propagate()
- propagates the input data (nnet.X
) through the neural net, thus calculating the output (nnet.YHat
)backpropagate()
- calculates correction values for the synapses