@@ -8,6 +8,8 @@
8{-# LANGUAGE MultiParamTypeClasses #-}
8{-# LANGUAGE MultiParamTypeClasses #-}
9{-# LANGUAGE FlexibleInstances #-}
9{-# LANGUAGE FlexibleInstances #-}
10{-# LANGUAGE FlexibleContexts #-}
10{-# LANGUAGE FlexibleContexts #-}
11+{-# LANGUAGE NoStarIsType #-}
12+{-# LANGUAGE UndecidableInstances #-}
12Module : Grenade.Layers.Deconvolution
14Module : Grenade.Layers.Deconvolution
13Description : Deconvolution layer
15Description : Deconvolution layer
@@ -39,6 +41,7 @@ import GHC.TypeLits hiding (natVal)
40import GHC.TypeLits
42import GHC.TypeLits
44+import Data.Kind (Type)
43import Numeric.LinearAlgebra hiding ( uniformSample, konst )
46import Numeric.LinearAlgebra hiding ( uniformSample, konst )
44import qualified Numeric.LinearAlgebra as LA
47import qualified Numeric.LinearAlgebra as LA
@@ -60,7 +63,7 @@ data Deconvolution :: Nat -- Number of channels, for the first layer this could
60 -> Nat -- The number of column in the kernel filter
63 -> Nat -- The number of column in the kernel filter
61 -> Nat -- The row stride of the Deconvolution filter
64 -> Nat -- The row stride of the Deconvolution filter
62 -> Nat -- The columns stride of the Deconvolution filter
65 -> Nat -- The columns stride of the Deconvolution filter
63− -> * where
66+ -> Type where
64 Deconvolution :: ( KnownNat channels
67 Deconvolution :: ( KnownNat channels
65 , KnownNat filters
68 , KnownNat filters
66 , KnownNat kernelRows
69 , KnownNat kernelRows
@@ -79,7 +82,7 @@ data Deconvolution' :: Nat -- Number of channels, for the first layer this could
79 -> Nat -- The number of column in the kernel filter
82 -> Nat -- The number of column in the kernel filter
80 -> Nat -- The row stride of the Deconvolution filter
83 -> Nat -- The row stride of the Deconvolution filter
81 -> Nat -- The columns stride of the Deconvolution filter
84 -> Nat -- The columns stride of the Deconvolution filter
82− -> * where
85+ -> Type where
83 Deconvolution' :: ( KnownNat channels
86 Deconvolution' :: ( KnownNat channels
84 , KnownNat filters
87 , KnownNat filters
85 , KnownNat kernelRows
88 , KnownNat kernelRows