Minimal library for creating neural networks.
npm package →
Nanoai is a fast, lightweight library for handling multi-layer perceptron (MLP) neural networks.
The addition of recurrent and convolutional layers is not planned at this time.
npm install @rbxts/nanoai
yarn add @rbxts/nanoai
pnpm add @rbxts/nanoai
Add littensy/nanoai
to your wally.toml
file.
[dependencies]
Nanoai = "littensy/nanoai@VERSION"
const model = Nanoai.create([2, 3, 1], Activation.TanH);
Nanoai.init.normal(model);
for (const _ of $range(1, 500)) {
Nanoai.backpropagate(model, [0, 1], [1], 0.3);
Nanoai.backpropagate(model, [1, 0], [1], 0.3);
Nanoai.backpropagate(model, [0, 0], [0], 0.3);
Nanoai.backpropagate(model, [1, 1], [0], 0.3);
}
Nanoai.predict(model, [0, 1]); // ~1
Nanoai is released under the MIT License.