fix(notmnist): notmnist sigmoid chart with 10 epochs
This commit is contained in:
parent
6b9cb1fa3e
commit
c0083f5c05
@ -43,7 +43,7 @@ module Main where
|
|||||||
|
|
||||||
let session = def { learningRate = 0.5
|
let session = def { learningRate = 0.5
|
||||||
, batchSize = 32
|
, batchSize = 32
|
||||||
, epochs = 9
|
, epochs = 10
|
||||||
, network = rnetwork
|
, network = rnetwork
|
||||||
, training = zip trinputs trlabels
|
, training = zip trinputs trlabels
|
||||||
, test = zip teinputs telabels
|
, test = zip teinputs telabels
|
||||||
|
BIN
notmnist.png
BIN
notmnist.png
Binary file not shown.
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 33 KiB |
BIN
sgd.png
BIN
sgd.png
Binary file not shown.
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 31 KiB |
@ -84,6 +84,7 @@ module Sibe
|
|||||||
, batchSize :: Int
|
, batchSize :: Int
|
||||||
, chart :: [(Int, Double, Double)]
|
, chart :: [(Int, Double, Double)]
|
||||||
, momentum :: Double
|
, momentum :: Double
|
||||||
|
, biases :: Bool
|
||||||
} deriving (Show)
|
} deriving (Show)
|
||||||
|
|
||||||
emptyNetwork = randomNetwork 0 (0, 0) 0 [] (0, (id, id))
|
emptyNetwork = randomNetwork 0 (0, 0) 0 [] (0, (id, id))
|
||||||
@ -97,6 +98,7 @@ module Sibe
|
|||||||
, batchSize = 0
|
, batchSize = 0
|
||||||
, chart = []
|
, chart = []
|
||||||
, momentum = 0
|
, momentum = 0
|
||||||
|
, biases = True
|
||||||
}
|
}
|
||||||
|
|
||||||
saveNetwork :: Network -> String -> IO ()
|
saveNetwork :: Network -> String -> IO ()
|
||||||
@ -122,6 +124,9 @@ module Sibe
|
|||||||
runLayer :: Input -> Layer -> Output
|
runLayer :: Input -> Layer -> Output
|
||||||
runLayer input (Layer !biases !weights _) = input <# weights + biases
|
runLayer input (Layer !biases !weights _) = input <# weights + biases
|
||||||
|
|
||||||
|
runLayer' :: Input -> Layer -> Output
|
||||||
|
runLayer' input (Layer !biases !weights _) = input <# weights
|
||||||
|
|
||||||
forward :: Input -> Session -> Output
|
forward :: Input -> Session -> Output
|
||||||
forward input session = compute input (network session)
|
forward input session = compute input (network session)
|
||||||
where
|
where
|
||||||
|
@ -26,14 +26,16 @@ module Sibe.Word2Vec
|
|||||||
return trainingData
|
return trainingData
|
||||||
let s = session { training = trainingData
|
let s = session { training = trainingData
|
||||||
, network = buildNetwork 0 (-1, 1) v [(v, 25, (id, one))] (20, v, (softmax, crossEntropy'))
|
, network = buildNetwork 0 (-1, 1) v [(v, 25, (id, one))] (20, v, (softmax, crossEntropy'))
|
||||||
|
, biases = False
|
||||||
}
|
}
|
||||||
print trainingData
|
print trainingData
|
||||||
newses <- run (gd . learningRateDecay (1.1, 0.1) . ignoreBiases) s
|
newses <- run (gd . learningRateDecay (1.1, 0.1)) s
|
||||||
|
|
||||||
let (hidden@(Layer biases nodes _) :- _) = network newses
|
let (hidden@(Layer biases nodes _) :- _) = network newses
|
||||||
{-let computedVocVec = map (\(w, v) -> (w, forward v newses)) vocvec-}
|
{-let computedVocVec = map (\(w, v) -> (w, forward v newses)) vocvec-}
|
||||||
let computedVocVec = map (\(w, v) -> (w, (fromRows [v]) <> nodes)) vocvec
|
print biases
|
||||||
print computedVocVec
|
let computedVocVec = map (\(w, v) -> (w, v <# nodes)) vocvec
|
||||||
|
{-print computedVocVec-}
|
||||||
|
|
||||||
{-mapM_ (\(w, v) -> do
|
{-mapM_ (\(w, v) -> do
|
||||||
putStr $ w ++ ": "
|
putStr $ w ++ ": "
|
||||||
|
Loading…
Reference in New Issue
Block a user