This release is 136 versions behind 0.168.1 — the latest version of @stsoftware/neat-ai. Jump to latest
@stsoftware/neat-ai@0.121.0Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
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.
import { assertEquals } from "jsr:@std/assert@^1.0.8"; import { Creature } from "../src/Creature.ts"; import type { CreatureInternal } from "../src/architecture/CreatureInterfaces.ts"; ((globalThis as unknown) as { DEBUG: boolean }).DEBUG = true; Deno.test("FromFrom", () => { const json: CreatureInternal = { neurons: [ { type: "hidden", squash: "LOGISTIC", bias: -1, index: 3, uuid: "h1" }, { type: "output", squash: "IDENTITY", index: 4, uuid: "h6", bias: 0, }, { type: "output", squash: "IDENTITY", index: 5, uuid: "h7", bias: 0, }, { type: "output", squash: "LOGISTIC", index: 6, uuid: "h8", bias: 0, }, ], synapses: [ { from: 1, to: 3, weight: 0.1 }, { from: 3, to: 4, weight: 0.2 }, { from: 4, to: 5, weight: 0.3 }, { from: 5, to: 6, weight: 0.4 }, ], input: 3, output: 3, }; const network = Creature.fromJSON(json); network.validate(); const preFixJSON = network.exportJSON(); network.fix(); const postFixJSON = network.exportJSON(); assertEquals(preFixJSON, postFixJSON); });