mirror of
https://github.com/tensorflow/haskell.git
synced 2024-11-26 21:09:44 +01:00
Merge branch 'master' of https://github.com/tensorflow/haskell
This commit is contained in:
commit
579bec26f0
3 changed files with 9 additions and 7 deletions
|
@ -1,3 +1,5 @@
|
|||
[![Build Status](https://ci.tensorflow.org/buildStatus/icon?job=tensorflow-haskell-master)](https://ci.tensorflow.org/job/tensorflow-haskell-master)
|
||||
|
||||
The tensorflow-haskell package provides Haskell bindings to
|
||||
[TensorFlow](https://www.tensorflow.org/).
|
||||
|
||||
|
|
|
@ -8,4 +8,4 @@ IMAGE_NAME=tensorflow/haskell/ci_build:v0
|
|||
|
||||
git submodule update
|
||||
docker build -t $IMAGE_NAME -f ci_build/Dockerfile .
|
||||
docker run -ti $IMAGE_NAME stack test
|
||||
docker run $IMAGE_NAME stack test
|
||||
|
|
|
@ -78,20 +78,20 @@ testLogisticOutput = testCase "testLogisticOutput" $ do
|
|||
vTargets = TF.vector $ targets inputs
|
||||
tfLoss = TF.sigmoidCrossEntropyWithLogits vLogits vTargets
|
||||
ourLoss = V.fromList $ sigmoidXentWithLogits (logits inputs) (targets inputs)
|
||||
|
||||
|
||||
r <- run tfLoss
|
||||
assertAllClose r ourLoss
|
||||
|
||||
|
||||
testLogisticOutputMultipleDim =
|
||||
testCase "testLogisticOutputMultipleDim" $ do
|
||||
let inputs = defInputs
|
||||
let inputs = defInputs
|
||||
shape = [2, 2, 2]
|
||||
vLogits = TF.constant shape (logits inputs)
|
||||
vTargets = TF.constant shape (targets inputs)
|
||||
tfLoss = TF.sigmoidCrossEntropyWithLogits vLogits vTargets
|
||||
ourLoss = V.fromList $ sigmoidXentWithLogits (logits inputs) (targets inputs)
|
||||
|
||||
|
||||
r <- run tfLoss
|
||||
assertAllClose r ourLoss
|
||||
|
||||
|
@ -101,7 +101,7 @@ testGradientAtZero = testCase "testGradientAtZero" $ do
|
|||
vLogits = TF.vector $ logits inputs
|
||||
vTargets = TF.vector $ targets inputs
|
||||
tfLoss = TF.sigmoidCrossEntropyWithLogits vLogits vTargets
|
||||
|
||||
|
||||
r <- run $ do
|
||||
l <- tfLoss
|
||||
TF.gradients l [vLogits]
|
||||
|
@ -113,7 +113,7 @@ run = TF.runSession . TF.buildAnd TF.run
|
|||
|
||||
|
||||
main :: IO ()
|
||||
main = googleTest [ testLogisticOutput
|
||||
main = googleTest [ testGradientAtZero
|
||||
, testLogisticOutput
|
||||
, testLogisticOutputMultipleDim
|
||||
, testGradientAtZero
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue