grenade-0.1.0: Practical Deep Learning in Haskell

Copyright(c) Huw Campbell 2016-2017
LicenseBSD2
Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

Grenade.Layers.Pooling

Description

 

Synopsis

Documentation

data Pooling :: Nat -> Nat -> Nat -> Nat -> * where Source #

A pooling layer for a neural network.

Does a max pooling, looking over a kernel similarly to the convolution network, but returning maxarg only. This layer is often used to provide minor amounts of translational invariance.

The kernel size dictates which input and output sizes will "fit". Fitting the equation: `out = (in - kernel) / stride + 1` for both dimensions.

Constructors

Pooling :: Pooling kernelRows kernelColumns strideRows strideColumns 

Instances

Show (Pooling k k' s s') Source # 

Methods

showsPrec :: Int -> Pooling k k' s s' -> ShowS #

show :: Pooling k k' s s' -> String #

showList :: [Pooling k k' s s'] -> ShowS #

Serialize (Pooling kernelRows kernelColumns strideRows strideColumns) Source # 

Methods

put :: Putter (Pooling kernelRows kernelColumns strideRows strideColumns) #

get :: Get (Pooling kernelRows kernelColumns strideRows strideColumns) #

UpdateLayer (Pooling kernelRows kernelColumns strideRows strideColumns) Source # 

Associated Types

type Gradient (Pooling kernelRows kernelColumns strideRows strideColumns) :: * Source #

Methods

runUpdate :: LearningParameters -> Pooling kernelRows kernelColumns strideRows strideColumns -> Gradient (Pooling kernelRows kernelColumns strideRows strideColumns) -> Pooling kernelRows kernelColumns strideRows strideColumns Source #

createRandom :: MonadRandom m => m (Pooling kernelRows kernelColumns strideRows strideColumns) Source #

runUpdates :: LearningParameters -> Pooling kernelRows kernelColumns strideRows strideColumns -> [Gradient (Pooling kernelRows kernelColumns strideRows strideColumns)] -> Pooling kernelRows kernelColumns strideRows strideColumns Source #

(KnownNat kernelRows, KnownNat kernelColumns, KnownNat strideRows, KnownNat strideColumns, KnownNat inputRows, KnownNat inputColumns, KnownNat outputRows, KnownNat outputColumns, (~) Nat (* ((-) outputRows 1) strideRows) ((-) inputRows kernelRows), (~) Nat (* ((-) outputColumns 1) strideColumns) ((-) inputColumns kernelColumns)) => Layer (Pooling kernelRows kernelColumns strideRows strideColumns) (D2 inputRows inputColumns) (D2 outputRows outputColumns) Source #

A two dimentional image can be pooled.

Associated Types

type Tape (Pooling kernelRows kernelColumns strideRows strideColumns) (D2 inputRows inputColumns :: Shape) (D2 outputRows outputColumns :: Shape) :: * Source #

Methods

runForwards :: Pooling kernelRows kernelColumns strideRows strideColumns -> S (D2 inputRows inputColumns) -> (Tape (Pooling kernelRows kernelColumns strideRows strideColumns) (D2 inputRows inputColumns) (D2 outputRows outputColumns), S (D2 outputRows outputColumns)) Source #

runBackwards :: Pooling kernelRows kernelColumns strideRows strideColumns -> Tape (Pooling kernelRows kernelColumns strideRows strideColumns) (D2 inputRows inputColumns) (D2 outputRows outputColumns) -> S (D2 outputRows outputColumns) -> (Gradient (Pooling kernelRows kernelColumns strideRows strideColumns), S (D2 inputRows inputColumns)) Source #

(KnownNat kernelRows, KnownNat kernelColumns, KnownNat strideRows, KnownNat strideColumns, KnownNat inputRows, KnownNat inputColumns, KnownNat outputRows, KnownNat outputColumns, KnownNat channels, KnownNat (* outputRows channels), (~) Nat (* ((-) outputRows 1) strideRows) ((-) inputRows kernelRows), (~) Nat (* ((-) outputColumns 1) strideColumns) ((-) inputColumns kernelColumns)) => Layer (Pooling kernelRows kernelColumns strideRows strideColumns) (D3 inputRows inputColumns channels) (D3 outputRows outputColumns channels) Source #

A three dimensional image can be pooled on each layer.

Associated Types

type Tape (Pooling kernelRows kernelColumns strideRows strideColumns) (D3 inputRows inputColumns channels :: Shape) (D3 outputRows outputColumns channels :: Shape) :: * Source #

Methods

runForwards :: Pooling kernelRows kernelColumns strideRows strideColumns -> S (D3 inputRows inputColumns channels) -> (Tape (Pooling kernelRows kernelColumns strideRows strideColumns) (D3 inputRows inputColumns channels) (D3 outputRows outputColumns channels), S (D3 outputRows outputColumns channels)) Source #

runBackwards :: Pooling kernelRows kernelColumns strideRows strideColumns -> Tape (Pooling kernelRows kernelColumns strideRows strideColumns) (D3 inputRows inputColumns channels) (D3 outputRows outputColumns channels) -> S (D3 outputRows outputColumns channels) -> (Gradient (Pooling kernelRows kernelColumns strideRows strideColumns), S (D3 inputRows inputColumns channels)) Source #

type Gradient (Pooling kr kc sr sc) Source # 
type Gradient (Pooling kr kc sr sc) = ()
type Tape (Pooling kernelRows kernelColumns strideRows strideColumns) (D2 inputRows inputColumns) (D2 outputRows outputColumns) Source # 
type Tape (Pooling kernelRows kernelColumns strideRows strideColumns) (D2 inputRows inputColumns) (D2 outputRows outputColumns) = S (D2 inputRows inputColumns)
type Tape (Pooling kernelRows kernelColumns strideRows strideColumns) (D3 inputRows inputColumns channels) (D3 outputRows outputColumns channels) Source # 
type Tape (Pooling kernelRows kernelColumns strideRows strideColumns) (D3 inputRows inputColumns channels) (D3 outputRows outputColumns channels) = S (D3 inputRows inputColumns channels)