资 源 简 介
Ocaml Neural Network Toolkit
This project uses the ocaml language (ocaml homepage).
It aims to implement the common neural network models in ocaml (perceptron, adaline, multilayer perceptrons...).
XOR Example
We want to create a perceptron that performs a XOR.
A perceptron takes an array of float values, returns another.
To represent boolean values, we take :
* false -> 0
* true -> 1
After compilation, you can run the ocaml top with the neural network libraries :
* ./onnt.top
You can then use the following script to create the perceptron :
(*Creation of multi-layer perceptron with : 2 inputs, 1 output, 2 layers and weights, biases randomized between -1 and 1 *)let pct = SigmoidMlPerceptron.random 2 1 [| 2; 1 |] 1. 1.;;
(*Learning base : array of (input, desired output) tuples*)let learn_base = [| [| 1.; 1.|], [| 0.|]; [| 1.; 0.|], [| 1.|]; [
文 件 列 表
onnt-0.1
adaline.mli
META
myocamlbuild.ml
onnt.odocl
.directory
mlPerceptron.ml
sigmoidMlPerceptron.ml
onnt.top
matrix.ml
test.ml
Makefile
neuralNetworkIo.mli
neuralNetwork.mli
mlPerceptron.mli
onnt.mllib
matrix.mli
stats.ml
LICENSE
adaline.ml
_tags
doc
vector.ml
sigmoidMlPerceptron.mli
README
neuralNetwork.ml
neuralNetworkIo.ml