Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
sauber/deno-neuronsPure-deno implementation of neural network inspired by Micrograd.
This package works with DenoIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun, Browsers
JSR Score
88%
Published
6 days ago (1.1.3)
deno-neurons
Pure-deno implementation of neural network.
Example
Neural network to recognize a circular wave.
import { Network, Train, Dashboard } from "jsr:@sauber/neurons"; const network = new Network(2).dense(8).lrelu.dense(6).lrelu.dense(1).tanh; const inputs: number[][] = []; const outputs: number[][] = []; for (let i = 0; i < 100; ++i) { const [x, y] = [Math.random() * 14 - 7, Math.random() * 14 - 7]; inputs.push([x, y]); outputs.push([-Math.sin(Math.sqrt(x * x + y * y))]); } const train = new Train(network, inputs, outputs); train.epsilon = 0.01; const dashboard = new Dashboard(train, 78, 16); const max_iteration = 20000; const learning_rate = 0.2; const count = train.run(max_iteration, learning_rate); console.log("Network trained in", count, "iterations.");
See Also
Use ML-CLI-Dashboard for ascii dashboard visualization during training.
Credits
Based on MicrogradTS
License
See LICENSE.
Built and signed on
View transparency logGitHub Actions
Add Package
deno add jsr:@sauber/neurons
Import symbol
import * as mod from "@sauber/neurons";
---- OR ----
Import directly with a jsr specifier
import * as mod from "jsr:@sauber/neurons";
Add Package
npx jsr add @sauber/neurons
Import symbol
import * as mod from "@sauber/neurons";
Add Package
yarn dlx jsr add @sauber/neurons
Import symbol
import * as mod from "@sauber/neurons";
Add Package
pnpm dlx jsr add @sauber/neurons
Import symbol
import * as mod from "@sauber/neurons";
Add Package
bunx jsr add @sauber/neurons
Import symbol
import * as mod from "@sauber/neurons";