Skip to main content
Home
This release is 136 versions behind 0.168.1 — 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
94%
Published
5 months ago (0.121.0)
Package root>test>NeuronUUID.ts
import type { CreatureInternal } from "../src/architecture/CreatureInterfaces.ts"; import { assert, assertEquals } from "jsr:@std/assert@^1.0.8"; import { Creature } from "../src/Creature.ts"; ((globalThis as unknown) as { DEBUG: boolean }).DEBUG = true; Deno.test("generateUUID", () => { const creature: CreatureInternal = { neurons: [ { bias: 0, index: 5, type: "hidden", squash: "IDENTITY", }, { bias: 0.1, index: 6, type: "output", squash: "IDENTITY", }, { bias: 0.2, index: 7, type: "output", squash: "IDENTITY", }, ], synapses: [ { weight: -0.1, from: 1, to: 5, }, { weight: 0.2, from: 4, to: 7, }, { weight: 0.1, from: 5, to: 6, }, ], input: 5, output: 2, tags: [ { name: "hello", value: "world" }, ], score: -0.1111, }; const n1 = Creature.fromJSON(creature); n1.neurons.forEach((n) => { assert(n.uuid, "Must have a UUID"); }); const j1 = n1.exportJSON(); const n2 = Creature.fromJSON(j1); for (let i = 0; i < n1.neurons.length; i++) { assertEquals(n1.neurons[i].uuid, n2.neurons[i].uuid); } });