Copyright | (c) Jean-Philippe Bernardy 2017 |
---|---|
License | LGPL-3 |
Maintainer | jean-philippe.bernardy@gu.se |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
- data DenseP t a b = DenseP {
- denseWeights :: Tensor '[a, b] (Flt t)
- denseBiases :: Tensor '[b] (Flt t)
- dense :: forall m n batchSize t. DenseP t n m -> Tensor '[n, batchSize] (Flt t) -> Tensor '[m, batchSize] (Flt t)
- (#) :: forall m n batchSize t. DenseP t n m -> Tensor '[n, batchSize] (Flt t) -> Tensor '[m, batchSize] (Flt t)
- data DropProb = DropProb Float
- mkDropout :: forall s t. KnownShape s => KnownBits t => DropProb -> Gen (Tensor s (Typ Float t) -> Tensor s (Typ Float t))
- mkDropouts :: KnownBits t => KnownLen shapes => All KnownShape shapes => DropProb -> Gen (HTV (Typ Float t) shapes -> HTV (Typ Float t) shapes)
- newtype EmbeddingP numObjects embeddingSize t = EmbeddingP (Tensor '[numObjects, embeddingSize] (Typ Float t))
- embedding :: forall embeddingSize numObjects batchSize t. EmbeddingP numObjects embeddingSize t -> Tensor '[batchSize] Int32 -> Tensor '[embeddingSize, batchSize] (Typ Float t)
- data ConvP t outChannels inChannels filterSpatialShape = ConvP (T ('[outChannels, inChannels] ++ filterSpatialShape) (Typ Float t)) (T '[outChannels] (Typ Float t))
- conv :: forall outChannels filterSpatialShape inChannels s t. ((1 + Length filterSpatialShape) ~ Length s, Length filterSpatialShape <= 3, KnownLen filterSpatialShape) => ConvP t outChannels inChannels filterSpatialShape -> T ('[inChannels] ++ s) (Typ Float t) -> T ('[outChannels] ++ s) (Typ Float t)
- maxPool2D :: forall stridex stridey batch height width channels t. (KnownNat stridex, KnownNat stridey) => T '[channels, width * stridex, height * stridex, batch] (Flt t) -> T '[channels, width, height, batch] (Flt t)
Dense
A dense layer is a linear function form a to b: a transformation matrix and a bias.
DenseP | |
|
dense :: forall m n batchSize t. DenseP t n m -> Tensor '[n, batchSize] (Flt t) -> Tensor '[m, batchSize] (Flt t) Source #
Dense layer (Apply a linear function)
(#) :: forall m n batchSize t. DenseP t n m -> Tensor '[n, batchSize] (Flt t) -> Tensor '[m, batchSize] (Flt t) Source #
Dense layer (Apply a linear function)
Dropout
A drop probability. (This type is used to make sure one does not confuse keep probability and drop probability)
mkDropout :: forall s t. KnownShape s => KnownBits t => DropProb -> Gen (Tensor s (Typ Float t) -> Tensor s (Typ Float t)) Source #
Generate a dropout function. The mask applied by the returned function will be constant for any given call to mkDropout. This behavior allows to use the same mask in the several steps of an RNN.
mkDropouts :: KnownBits t => KnownLen shapes => All KnownShape shapes => DropProb -> Gen (HTV (Typ Float t) shapes -> HTV (Typ Float t) shapes) Source #
Generate a dropout function for an heterogeneous tensor vector.
Embedding
newtype EmbeddingP numObjects embeddingSize t Source #
Parameters for the embedding layers
EmbeddingP (Tensor '[numObjects, embeddingSize] (Typ Float t)) |
(KnownNat numObjects, KnownBits NBits b, KnownNat embeddingSize) => ParamWithDefault (EmbeddingP numObjects embeddingSize b) Source # | |
(KnownNat numObjects, KnownBits NBits b, KnownNat embeddingSize) => KnownTensors (EmbeddingP numObjects embeddingSize b) Source # | |
embedding :: forall embeddingSize numObjects batchSize t. EmbeddingP numObjects embeddingSize t -> Tensor '[batchSize] Int32 -> Tensor '[embeddingSize, batchSize] (Typ Float t) Source #
embedding layer
Convolutional
data ConvP t outChannels inChannels filterSpatialShape Source #
ConvP (T ('[outChannels, inChannels] ++ filterSpatialShape) (Typ Float t)) (T '[outChannels] (Typ Float t)) |
(KnownNat outChannels, KnownNat inChannels, KnownShape filterSpatialShape, KnownBits NBits t) => ParamWithDefault (ConvP t outChannels inChannels filterSpatialShape) Source # | |
(KnownNat outChannels, KnownNat inChannels, KnownShape filterSpatialShape, KnownBits NBits t) => KnownTensors (ConvP t outChannels inChannels filterSpatialShape) Source # | |
conv :: forall outChannels filterSpatialShape inChannels s t. ((1 + Length filterSpatialShape) ~ Length s, Length filterSpatialShape <= 3, KnownLen filterSpatialShape) => ConvP t outChannels inChannels filterSpatialShape -> T ('[inChannels] ++ s) (Typ Float t) -> T ('[outChannels] ++ s) (Typ Float t) Source #
Size-preserving convolution layer