Repository
Current version released
2 years ago
Dependencies
github.com
Netsaur
neo
neural network deno module usingMaintainers
- Loading (@load1n9)
- CarrotzRule (@carrotzrule123)
Usage
import { NeuralNetwork } from "https://deno.land/x/netsaur/mod.ts";
const net = await new NeuralNetwork({
hidden: [
{ size: 2, activation: "sigmoid" },
],
cost: "crossentropy",
output: { size: 1, activation: "sigmoid" },
input: {
type: "f32",
},
}).setupBackend(false);
net.train(
[
{ inputs: [0, 0], outputs: [0] },
{ inputs: [1, 0], outputs: [1] },
{ inputs: [0, 1], outputs: [1] },
{ inputs: [1, 1], outputs: [0] },
],
1000,
1,
0.1,
);
console.log(net.predict(new Float32Array([0, 0])));
console.log(net.predict(new Float32Array([1, 0])));
console.log(net.predict(new Float32Array([0, 1])));
console.log(net.predict(new Float32Array([1, 1])));