grenade-0.1.0: Practical Deep Learning in Haskell

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

Grenade.Layers.Merge

Description

 

Synopsis

Documentation

data Merge :: * -> * -> * where Source #

A Merging layer.

Similar to Concat layer, except sums the activations instead of creating a larger shape.

Constructors

Merge :: x -> y -> Merge x y 

Instances

(Show x, Show y) => Show (Merge x y) Source # 

Methods

showsPrec :: Int -> Merge x y -> ShowS #

show :: Merge x y -> String #

showList :: [Merge x y] -> ShowS #

(Serialize a, Serialize b) => Serialize (Merge a b) Source # 

Methods

put :: Putter (Merge a b) #

get :: Get (Merge a b) #

(UpdateLayer x, UpdateLayer y) => UpdateLayer (Merge x y) Source #

Run two layers in parallel, combining their outputs. This just kind of "smooshes" the weights together.

Associated Types

type Gradient (Merge x y) :: * Source #

(SingI Shape i, SingI Shape o, Layer x i o, Layer y i o) => Layer (Merge x y) i o Source #

Combine the outputs and the inputs, summing the output shape

Associated Types

type Tape (Merge x y) (i :: Shape) (o :: Shape) :: * Source #

Methods

runForwards :: Merge x y -> S i -> (Tape (Merge x y) i o, S o) Source #

runBackwards :: Merge x y -> Tape (Merge x y) i o -> S o -> (Gradient (Merge x y), S i) Source #

type Gradient (Merge x y) Source # 
type Gradient (Merge x y) = (Gradient x, Gradient y)
type Tape (Merge x y) i o Source # 
type Tape (Merge x y) i o = (Tape x i o, Tape y i o)