chore(README): unnecessary space
This commit is contained in:
parent
ace9b7f5f9
commit
44f2ae372a
20
README.md
20
README.md
@ -4,9 +4,9 @@ A simple Machine Learning library.
|
||||
|
||||
## Simple neural network
|
||||
```haskell
|
||||
import Numeric.Sibe
|
||||
import Numeric.Sibe
|
||||
|
||||
let a = (sigmoid, sigmoid') -- activation function
|
||||
let a = (sigmoid, sigmoid') -- activation function
|
||||
-- random network, seed 0, values between -1 and 1,
|
||||
-- two inputs, two nodes in hidden layer and a single output
|
||||
rnetwork = randomNetwork 0 (-1, 1) 2 [(2, a)] (1, a)
|
||||
@ -27,19 +27,19 @@ A simple Machine Learning library.
|
||||
|
||||
initialCost = crossEntropy session
|
||||
|
||||
-- run gradient descent
|
||||
-- you can also use `sgd`, see the notmnist example
|
||||
newsession <- run gd session
|
||||
-- run gradient descent
|
||||
-- you can also use `sgd`, see the notmnist example
|
||||
newsession <- run gd session
|
||||
|
||||
let results = map (`forward` newsession) inputs
|
||||
let results = map (`forward` newsession) inputs
|
||||
rounded = map (map round . toList) results
|
||||
|
||||
cost = crossEntropy newsession
|
||||
|
||||
putStrLn $ "- initial cost (cross-entropy): " ++ show initialCost
|
||||
putStrLn $ "- actual result: " ++ show results
|
||||
putStrLn $ "- rounded result: " ++ show rounded
|
||||
putStrLn $ "- cost (cross-entropy): " ++ show cost
|
||||
putStrLn $ "- initial cost (cross-entropy): " ++ show initialCost
|
||||
putStrLn $ "- actual result: " ++ show results
|
||||
putStrLn $ "- rounded result: " ++ show rounded
|
||||
putStrLn $ "- cost (cross-entropy): " ++ show cost
|
||||
```
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user