summaryrefslogtreecommitdiff
path: root/test/MindTest.hs
diff options
context:
space:
mode:
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) ]
+ )
]