Permalink
Browse files

mapM_ not mapM

  • Loading branch information...
1 parent 327a043 commit 4b08e983f38e8eff62151f89e1c90529cbd361e3 @larrytheliquid committed Jan 28, 2010
Showing with 7 additions and 8 deletions.
  1. +1 −0 .gitignore
  2. +6 −8 PerceptronTest.hs
View
@@ -3,3 +3,4 @@ vendor/gems/*
!vendor/gems/cache/
*.hi
*.o
+\#*
View
@@ -18,27 +18,25 @@ main = runTestTT (TestList [
[[0.0], [1.0], [1.0], [0.0]]
[[0.1, 0.2, -0.4], [0.3, 0.2, -0.1]]
[[0.1, 0.2, 0.3]]
- in do
- mapM (\(x,y) -> assertClose "returns the new hidden & output weights groups" (x, 0.0001) y)
+ in
+ mapM_ (\(x,y) -> assertClose "returns the new hidden & output weights groups" (x, 0.0001) y)
(zip [0.0923, 0.1958, -0.4049,
0.2904, 0.1946, -0.1057,
0.0276, 0.1621, 0.2559]
- (concat (hiddenWeights ++ outputWeights)))
- True @=? True,
+ (concat (hiddenWeights ++ outputWeights))),
"pattern given input and output nodes, and hidden and output weights groups" ~:
let (hiddenWeights, outputWeights) = pattern 1.0
[0.0, 0.0]
[0.0]
[[0.1, 0.2, -0.4], [0.3, 0.2, -0.1]]
[[0.1, 0.2, 0.3]]
- in do
- mapM (\(x,y) -> assertClose "returns the new hidden & output weights groups" (x, 0.0001) y)
+ in
+ mapM_ (\(x,y) -> assertClose "returns the new hidden & output weights groups" (x, 0.0001) y)
(zip [0.0929, 0.2, -0.4,
0.2895, 0.2, -0.1,
-0.0431, 0.1249, 0.2178]
- (concat (hiddenWeights ++ outputWeights)))
- True @=? True,
+ (concat (hiddenWeights ++ outputWeights))),
"averageError given input and output patterns, and hidden and output weights groups " ++
"returns the sum of squared errors" ~:

0 comments on commit 4b08e98

Please sign in to comment.