From 5f2683c0aff63880794b2f3262e0d6abc76bd80a Mon Sep 17 00:00:00 2001 From: sanine Date: Wed, 8 Nov 2023 23:09:41 -0600 Subject: export extra topology functions & add agent.js --- src/mind/topology.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mind/topology.js') diff --git a/src/mind/topology.js b/src/mind/topology.js index 127351e..9c5ecf7 100644 --- a/src/mind/topology.js +++ b/src/mind/topology.js @@ -46,7 +46,7 @@ function is_hidden(n, index) { // returns a new network with an edge between the given nodes // with the given weight -function network_connect(n, source, sink, weight) { +export function network_connect(n, source, sink, weight) { if (is_input(n, sink)) { // inputs cannot be sinks throw new Error("attempt to use input as sink"); @@ -146,7 +146,7 @@ function get_value(n, index, input, prev, cache) { // compute a network's output and new hidden state // given the input and previous hidden state -function network_compute(n, input, state) { +export function network_compute(n, input, state) { // validate input if (input.length !== n.input_count) { throw new Error("incorrect number of input elements"); -- cgit v1.2.1