Skip to main content
This release is 125 versions behind 0.165.7 — the latest version of @stsoftware/neat-ai. Jump to latest

Built and signed on GitHub Actions

NEAT Neural Network. This project is a unique implementation of a neural network based on the NEAT (NeuroEvolution of Augmenting Topologies) algorithm, written in DenoJS using TypeScript.

This package works with Deno
This package works with Deno
JSR Score
100%
Published
4 months ago (0.121.0)

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Package root>test>InFocus.ts
import { assert } from "jsr:@std/assert@^1.0.8"; import { Creature } from "../src/Creature.ts"; ((globalThis as unknown) as { DEBUG: boolean }).DEBUG = true; Deno.test("hidden", () => { const json = JSON.parse(Deno.readTextFileSync("./test/data/inFocus.json")); const network = Creature.fromJSON(json); let positiveCount = 0; let negativeCount = 0; const startPos = network.input; const endPos = network.neurons.length - network.output; for (let pos = startPos; pos < endPos; pos++) { const n = network.neurons[pos]; if (network.inFocus(n.index ? n.index : 0, [1])) { positiveCount++; } else { negativeCount++; } } assert(positiveCount > 0, "No positives"); assert(negativeCount > 0, "No negatives"); }); Deno.test("input", () => { const json = JSON.parse(Deno.readTextFileSync("./test/data/inFocus.json")); const network = Creature.fromJSON(json); let positiveCount = 0; let negativeCount = 0; const startPos = 0; const endPos = network.input; for (let pos = startPos; pos < endPos; pos++) { const n = network.neurons[pos]; if (network.inFocus(n.index ? n.index : 0, [1])) { positiveCount++; } else { negativeCount++; } } assert(positiveCount > 0, "No positives"); assert(negativeCount > 0, "No negatives"); });