grenade-0.1.0: Practical Deep Learning in Haskell

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

Grenade.Layers.Reshape

Description

 

Synopsis

Documentation

data Reshape Source #

Reshape Layer

The Reshape layer can flatten any 2D or 3D image to 1D vector with the same number of activations, as well as cast up from 1D to a 2D or 3D shape.

Can also be used to turn a 3D image with only one channel into a 2D image or vice versa.

Constructors

Reshape 

Instances

Show Reshape Source # 
Serialize Reshape Source # 
UpdateLayer Reshape Source # 
(KnownNat a, KnownNat x, KnownNat y, (~) Nat a (* x y)) => Layer Reshape (D1 a) (D2 x y) Source # 

Associated Types

type Tape Reshape (D1 a :: Shape) (D2 x y :: Shape) :: * Source #

Methods

runForwards :: Reshape -> S (D1 a) -> (Tape Reshape (D1 a) (D2 x y), S (D2 x y)) Source #

runBackwards :: Reshape -> Tape Reshape (D1 a) (D2 x y) -> S (D2 x y) -> (Gradient Reshape, S (D1 a)) Source #

(KnownNat a, KnownNat x, KnownNat y, KnownNat (* x z), KnownNat z, (~) Nat a (* (* x y) z)) => Layer Reshape (D1 a) (D3 x y z) Source # 

Associated Types

type Tape Reshape (D1 a :: Shape) (D3 x y z :: Shape) :: * Source #

Methods

runForwards :: Reshape -> S (D1 a) -> (Tape Reshape (D1 a) (D3 x y z), S (D3 x y z)) Source #

runBackwards :: Reshape -> Tape Reshape (D1 a) (D3 x y z) -> S (D3 x y z) -> (Gradient Reshape, S (D1 a)) Source #

(KnownNat a, KnownNat x, KnownNat y, (~) Nat a (* x y)) => Layer Reshape (D2 x y) (D1 a) Source # 

Associated Types

type Tape Reshape (D2 x y :: Shape) (D1 a :: Shape) :: * Source #

Methods

runForwards :: Reshape -> S (D2 x y) -> (Tape Reshape (D2 x y) (D1 a), S (D1 a)) Source #

runBackwards :: Reshape -> Tape Reshape (D2 x y) (D1 a) -> S (D1 a) -> (Gradient Reshape, S (D2 x y)) Source #

(KnownNat y, KnownNat x, KnownNat z, (~) Nat z 1) => Layer Reshape (D2 x y) (D3 x y z) Source # 

Associated Types

type Tape Reshape (D2 x y :: Shape) (D3 x y z :: Shape) :: * Source #

Methods

runForwards :: Reshape -> S (D2 x y) -> (Tape Reshape (D2 x y) (D3 x y z), S (D3 x y z)) Source #

runBackwards :: Reshape -> Tape Reshape (D2 x y) (D3 x y z) -> S (D3 x y z) -> (Gradient Reshape, S (D2 x y)) Source #

(KnownNat a, KnownNat x, KnownNat y, KnownNat (* x z), KnownNat z, (~) Nat a (* (* x y) z)) => Layer Reshape (D3 x y z) (D1 a) Source # 

Associated Types

type Tape Reshape (D3 x y z :: Shape) (D1 a :: Shape) :: * Source #

Methods

runForwards :: Reshape -> S (D3 x y z) -> (Tape Reshape (D3 x y z) (D1 a), S (D1 a)) Source #

runBackwards :: Reshape -> Tape Reshape (D3 x y z) (D1 a) -> S (D1 a) -> (Gradient Reshape, S (D3 x y z)) Source #

(KnownNat y, KnownNat x, KnownNat z, (~) Nat z 1) => Layer Reshape (D3 x y z) (D2 x y) Source # 

Associated Types

type Tape Reshape (D3 x y z :: Shape) (D2 x y :: Shape) :: * Source #

Methods

runForwards :: Reshape -> S (D3 x y z) -> (Tape Reshape (D3 x y z) (D2 x y), S (D2 x y)) Source #

runBackwards :: Reshape -> Tape Reshape (D3 x y z) (D2 x y) -> S (D2 x y) -> (Gradient Reshape, S (D3 x y z)) Source #

type Gradient Reshape Source # 
type Gradient Reshape = ()
type Tape Reshape (D1 a) (D2 x y) Source # 
type Tape Reshape (D1 a) (D2 x y) = ()
type Tape Reshape (D1 a) (D3 x y z) Source # 
type Tape Reshape (D1 a) (D3 x y z) = ()
type Tape Reshape (D2 x y) (D1 a) Source # 
type Tape Reshape (D2 x y) (D1 a) = ()
type Tape Reshape (D2 x y) (D3 x y z) Source # 
type Tape Reshape (D2 x y) (D3 x y z) = ()
type Tape Reshape (D3 x y z) (D1 a) Source # 
type Tape Reshape (D3 x y z) (D1 a) = ()
type Tape Reshape (D3 x y z) (D2 x y) Source # 
type Tape Reshape (D3 x y z) (D2 x y) = ()