summaryrefslogtreecommitdiff
path: root/src/mind/topology.js
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-06-17 12:55:58 -0500
committersanine <sanine.not@pm.me>2023-06-17 12:55:58 -0500
commit9f233aa540f01848fea62f6f5031142c6e96621a (patch)
tree966abf8f138d0363f5b1f6007a5ab748d47d4faa /src/mind/topology.js
parentc079d06fdeeaa5e7a7b007e5bbc35a2d19bbc316 (diff)
fix the order of arbitrary neuron test
Diffstat (limited to 'src/mind/topology.js')
-rw-r--r--src/mind/topology.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mind/topology.js b/src/mind/topology.js
index 5d4d52c..8e59c54 100644
--- a/src/mind/topology.js
+++ b/src/mind/topology.js
@@ -116,13 +116,14 @@ function get_value(n, index, input, prev, cache) {
}
const adj = n.adjacency[index]; // get adjacency list
- const incident = incident_edges(n, adj); // get incident edges
+ const incident = incident_edges(n, adj); // get incident edges
const weight = incident.map(x => n.weight[x]); // edge weights
const sources = incident // get ancestor nodes
.map(x => edge_ends(n, x).source);
- const values = sources // get the value of each ancestor
- .map(x => x === index // if the ancestor is this node
+ // get the value of each ancestor
+ const values = sources
+ .map(x => x === index // if the ancestor is this node
? prev[x - n.input_count] // then the value is the previous value
: get_value(n, x, input, prev, cache)); // else recurse