summaryrefslogtreecommitdiff
path: root/src/mind/topology.js
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-11-08 23:09:41 -0600
committersanine <sanine.not@pm.me>2023-11-08 23:09:41 -0600
commit5f2683c0aff63880794b2f3262e0d6abc76bd80a (patch)
treec896e6af6143c77b05f359d7ba988875f241934c /src/mind/topology.js
parentf78493e192daf4639b91352909e4029b9970fcdb (diff)
export extra topology functions & add agent.js
Diffstat (limited to 'src/mind/topology.js')
-rw-r--r--src/mind/topology.js4
1 files changed, 2 insertions, 2 deletions
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");