summaryrefslogtreecommitdiff
path: root/test/MindTest.hs
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-11-21 23:41:38 -0600
committersanine <sanine.not@pm.me>2023-11-21 23:41:38 -0600
commit435c52c7330bcd49328a8facfc5a11b00e4a41bf (patch)
tree3431819acd8d6e2e2efd11c476510990abe739ef /test/MindTest.hs
parent26be9f9dc7d57aa76e6c5eb4dd95681df3bde309 (diff)
implement self-connected computation
Diffstat (limited to 'test/MindTest.hs')
-rw-r--r--test/MindTest.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/MindTest.hs b/test/MindTest.hs
index 7b208b4..efa79ef 100644
--- a/test/MindTest.hs
+++ b/test/MindTest.hs
@@ -131,4 +131,16 @@ networkTests = testGroup "network tests" $
, tanh (5-3)
]
)
+ , testCase "computing with self-connection" $
+ let
+ net = Network 0
+ -- hidden neurons
+ [ [ Edge (Internal 0, negate 0.5) ] ]
+ -- output neurons
+ [ [ Edge (Internal 0, 2) ] ]
+ Just result = compute net [] [1.0]
+ in result @?=
+ ( [ tanh $ 2 * (tanh (negate 0.5)) ]
+ , [ tanh (negate 0.5) ]
+ )
]