Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/load1n9/synaptic
dependency-less neural network library ported to deno
https://github.com/load1n9/synaptic
Last synced: about 2 months ago
JSON representation
dependency-less neural network library ported to deno
- Host: GitHub
- URL: https://github.com/load1n9/synaptic
- Owner: load1n9
- Created: 2021-05-20T23:31:52.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-05-23T21:00:22.000Z (over 3 years ago)
- Last Synced: 2024-10-04T15:47:15.490Z (2 months ago)
- Language: JavaScript
- Size: 51.8 KB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-deno - synaptic - Dependency-less neural network library ported to deno (Modules / Machine learning)
README
dependency-less neural network library
Synaptic.js ported to Deno## Usage:
```ts
import { Layer, Network, Trainer } from "./mod.ts";
class Perceptron extends Network {
public constructor(input: any, hidden: any, output: any) {
super();
let inputLayer = new Layer(input);
let hiddenLayer = new Layer(hidden);
let outputLayer = new Layer(output);inputLayer.project(hiddenLayer);
hiddenLayer.project(outputLayer);this.set({
input: inputLayer,
hidden: [hiddenLayer],
output: outputLayer,
});
}
}let myPerceptron = new Perceptron(2,3,1);
let myTrainer = new Trainer(myPerceptron);
myTrainer.XOR();
myPerceptron.activate([0,0]); // 0.0268581547421616
myPerceptron.activate([1,0]); // 0.9829673642853368
myPerceptron.activate([0,1]); // 0.9831714267395621
myPerceptron.activate([1,1]); // 0.02128894618097928
``````
deno run -A ./test.ts
```