on master help sign in
Bump hedgehog
commitce519278e826691ea4203f29f4a8e42fffb91cba authorHuw Campbell <huw.campbell@ambiata.com> dateSun 9 Jul 2017, 19:42 (9 years ago) parent88b217d
12 files changed+20−18
grenade.cabal+1−1 test/Test/Grenade/Layers/Convolution.hs+1−1 test/Test/Grenade/Layers/FullyConnected.hs+1−1 test/Test/Grenade/Layers/Internal/Convolution.hs+1−2 test/Test/Grenade/Layers/Internal/Pooling.hs+1−1 test/Test/Grenade/Layers/Nonlinear.hs+3−4 test/Test/Grenade/Layers/PadCrop.hs+1−1 test/Test/Grenade/Layers/Pooling.hs+1−1 test/Test/Grenade/Network.hs+1−1 test/Test/Grenade/Recurrent/Layers/LSTM.hs+1−1 test/Test/Hedgehog/Compat.hs+2−4 test/Test/Hedgehog/TypeLits.hs+6
grenade.cabal+1−1
@@ -149,7 +149,7 @@ test-suite test
149149 build-depends:
150150 base >= 4.8 && < 5
151151 , grenade
152− , hedgehog >= 0.1 && < 0.2
152+ , hedgehog >= 0.4 && < 0.5
153153 , hmatrix
154154 , mtl
155155 , singletons
test/Test/Grenade/Layers/Convolution.hs+1−1
@@ -101,4 +101,4 @@ prop_conv_net = property $
101101
102102
103103tests :: IO Bool
104−tests = $$(checkConcurrent)
104+tests = checkParallel $$(discover)
test/Test/Grenade/Layers/FullyConnected.hs+1−1
@@ -50,4 +50,4 @@ prop_fully_connected_forwards = property $ do
5050 backed `seq` success
5151
5252tests :: IO Bool
53−tests = $$(checkConcurrent)
53+tests = checkParallel $$(discover)
test/Test/Grenade/Layers/Internal/Convolution.hs+1−2
@@ -53,6 +53,5 @@ prop_im2col_col2im_behaves_as_reference =
5353 outFast === outReference
5454 retFast === retReference
5555
56−return []
5756tests :: IO Bool
58−tests = $$(checkConcurrent)
57+tests = checkParallel $$(discover)
test/Test/Grenade/Layers/Internal/Pooling.hs+1−1
@@ -42,4 +42,4 @@ prop_poolForwards_poolBackwards_behaves_as_reference =
4242
4343
4444tests :: IO Bool
45−tests = $$(checkConcurrent)
45+tests = checkParallel $$(discover)
test/Test/Grenade/Layers/Nonlinear.hs+3−4
@@ -22,7 +22,7 @@ import Numeric.LinearAlgebra.Static ( norm_Inf )
2222
2323prop_sigmoid_grad :: Property
2424prop_sigmoid_grad = property $
25− blindForAll genShape >>= \case
25+ forAllWith rss genShape >>= \case
2626 (SomeSing (r :: Sing s)) ->
2727 withSingI r $
2828 blindForAll genOfShape >>= \(ds :: S s) ->
@@ -37,7 +37,7 @@ prop_sigmoid_grad = property $
3737
3838prop_tanh_grad :: Property
3939prop_tanh_grad = property $
40− blindForAll genShape >>= \case
40+ forAllWith rss genShape >>= \case
4141 (SomeSing (r :: Sing s)) ->
4242 withSingI r $
4343 blindForAll genOfShape >>= \(ds :: S s) ->
@@ -51,5 +51,4 @@ prop_tanh_grad = property $
5151 (S3D x) -> norm_Inf x < 0.001) :: Bool)
5252
5353tests :: IO Bool
54−tests = $$(checkConcurrent)
55−
54+tests = checkParallel $$(discover)
test/Test/Grenade/Layers/PadCrop.hs+1−1
@@ -50,4 +50,4 @@ prop_pad_crop_2d =
5050
5151
5252tests :: IO Bool
53−tests = $$(checkConcurrent)
53+tests = checkParallel $$(discover)
test/Test/Grenade/Layers/Pooling.hs+1−1
@@ -42,4 +42,4 @@ prop_pool_layer_witness =
4242 assert True
4343
4444tests :: IO Bool
45−tests = $$(checkConcurrent)
45+tests = checkParallel $$(discover)
test/Test/Grenade/Network.hs+1−1
@@ -303,4 +303,4 @@ infix 4 ~~~
303303
304304
305305tests :: IO Bool
306−tests = $$(checkConcurrent)
306+tests = checkParallel $$(discover)
test/Test/Grenade/Recurrent/Layers/LSTM.hs+1−1
@@ -122,4 +122,4 @@ prop_lstm_reference_backwards_cell =
122122infix 4 ~~~
123123
124124tests :: IO Bool
125−tests = $$(checkConcurrent)
125+tests = checkParallel $$(discover)
test/Test/Hedgehog/Compat.hs+2−4
@@ -9,8 +9,6 @@ module Test.Hedgehog.Compat (
99
1010import Control.Monad.Trans.Class (MonadTrans(..))
1111
12−import Data.Typeable ( typeOf )
13−
1412import qualified Hedgehog.Gen as Gen
1513import qualified Hedgehog.Range as Range
1614import Hedgehog.Internal.Property
@@ -30,11 +28,11 @@ blindForAll = Test . lift . lift
3028semiBlindForAll :: (Monad m, Show a, HasCallStack) => Gen.Gen m a -> Test m a
3129semiBlindForAll gen = do
3230 x <- Test . lift $ lift gen
33− writeLog $ Input (getCaller callStack) (typeOf ()) (showPretty x)
31+ annotate (showPretty x)
3432 return x
3533
3634forAllRender :: (Monad m, HasCallStack) => ( a -> String ) -> Gen.Gen m a -> Test m a
3735forAllRender render gen = do
3836 x <- Test . lift $ lift gen
39− writeLog $ Input (getCaller callStack) (typeOf ()) (render x)
37+ footnote (render x)
4038 return x
test/Test/Hedgehog/TypeLits.hs+6
@@ -62,3 +62,9 @@ genD3 = do
6262 (SomeNat (px :: Proxy x), SomeNat (_ :: Proxy y), SomeNat (pz :: Proxy z)) ->
6363 case natDict px %* natDict pz of
6464 Dict -> SomeSing (sing :: Sing ('D3 x y z))
65+
66+rss :: SomeSing Shape' -> String
67+rss (SomeSing (r :: Sing s)) = case r of
68+ (D1Sing a@SNat) -> "D1 " ++ show (natVal a)
69+ (D2Sing a@SNat b@SNat) -> "D2 " ++ show (natVal a) ++ " " ++ show (natVal b)
70+ (D3Sing a@SNat b@SNat c@SNat) -> "D3 " ++ show (natVal a) ++ " " ++ show (natVal b) ++ " " ++ show (natVal c)