Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module declares all Shape related functions and data structures, as well as all singleton -- instances for the Shape data type. This module was highly influenciated by Grenade, a Haskell -- library for deep learning with dependent types. See: https://github.com/HuwCampbell/grenade
Documentation
The current shapes we accept. at the moment this is just one, two, and three dimensional Vectors/Matricies.
These are only used with DataKinds, as Kind Shape
, with Types 'D1, 'D2, 'D3.
D1 Nat | One dimensional vector |
D2 Nat Nat | Two dimensional matrix. Row, Column. |
D3 Nat Nat Nat | Three dimensional matrix. Row, Column, Channels. |
Instances
KnownNat a => SingI (D1 a :: Shape) Source # | |
Defined in TensorSafe.Shape | |
(KnownNat a, KnownNat b) => SingI (D2 a b :: Shape) Source # | |
Defined in TensorSafe.Shape | |
(KnownNat a, KnownNat b, KnownNat c) => SingI (D3 a b c :: Shape) Source # | |
Defined in TensorSafe.Shape | |
SingI i => ValidNetwork ([] :: [Type]) (i ': ([] :: [Shape])) Source # | |
Defined in TensorSafe.Network mkINetwork :: INetwork [] (i ': []) Source # | |
(Show x, Show (INetwork xs rs)) => Show (INetwork (x ': xs) (i ': rs)) Source # | |
Show (INetwork ([] :: [Type]) (i ': ([] :: [Shape]))) Source # | |
(SingI i, SingI o, Layer x, ValidNetwork xs (o ': rs), Out x i ~ o) => ValidNetwork (x ': xs) (i ': (o ': rs)) Source # | |
Defined in TensorSafe.Network mkINetwork :: INetwork (x ': xs) (i ': (o ': rs)) Source # | |
data Sing (n :: Shape) Source # | |
Defined in TensorSafe.Shape data Sing (n :: Shape) where
|
data S (n :: Shape) where Source #
Concrete data structures for a Shape.
All shapes are held in contiguous memory. 3D is held in a matrix (usually row oriented) which has height depth * rows.
type family ShapeEquals (sIn :: Shape) (sOut :: Shape) :: Bool where ... Source #
Compares two Shapes at kinds level and returns a Bool kind
ShapeEquals s s = True | |
ShapeEquals _ _ = False |