Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/littensy/nanoai
✨ Minimal library for creating neural networks
https://github.com/littensy/nanoai
machine-learning neural-network roblox roblox-ts typescript
Last synced: 30 days ago
JSON representation
✨ Minimal library for creating neural networks
- Host: GitHub
- URL: https://github.com/littensy/nanoai
- Owner: littensy
- License: mit
- Created: 2024-05-27T04:23:57.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-09-02T16:32:29.000Z (4 months ago)
- Last Synced: 2024-11-22T10:30:32.185Z (about 2 months ago)
- Topics: machine-learning, neural-network, roblox, roblox-ts, typescript
- Language: Luau
- Homepage:
- Size: 50.8 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Nanoai
Minimal library for creating neural networks.
npm package →
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/littensy/nanoai/ci.yml?style=for-the-badge&branch=master&logo=github)
[![NPM Version](https://img.shields.io/npm/v/@rbxts/nanoai.svg?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/@rbxts/nanoai)
[![GitHub License](https://img.shields.io/github/license/littensy/nanoai?style=for-the-badge)](LICENSE.md)**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.
## 📦 Setup
### TypeScript
```sh
npm install @rbxts/nanoai
yarn add @rbxts/nanoai
pnpm add @rbxts/nanoai
```### Wally
Add `littensy/nanoai` to your `wally.toml` file.
```toml
[dependencies]
Nanoai = "littensy/nanoai@VERSION"
```## 📚 API Reference
#### `create(shape, activation)`
#### `predict(network, input)`
#### `backpropagate(network, input, expected, learningRate)`
#### `evolution(options)`
#### `init[type](network, ...)`
#### `initialize(network, initializer)`
#### `clone(network)`
## 🚀 Examples
### XOR problem
```lua
local model = Nanoai.create({ 2, 3, 1 }, Nanoai.Activation.TanH)Nanoai.init.normal(model)
for _ = 1, 500 do
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)
endNanoai.predict(model, { 0, 1 }) -- ~1
```---
Nanoai is released under the MIT License.[![MIT License](https://img.shields.io/github/license/littensy/nanoai?style=for-the-badge)](LICENSE.md)