pooling

package
v0.0.0-...-98db5b7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2020 License: CC-BY-4.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layer

type Layer struct {
	// contains filtered or unexported fields
}

Layer holds everything it needs on the pooling side in order to do the pooling operations.

func Setup

func Setup(handle *cudnn.Handler, mode gocudnn.PoolingMode, nan gocudnn.NANProp, input *layers.Tensor, window, padding, stride []int32) (l *Layer, y, dy *layers.Tensor, err error)

Setup setsup the pooling layer and returns a pointer to the struct. Scalars are set to the default alpha =1.0 and beta =0.0 for both fwd and bwd.

func SetupNoOutput

func SetupNoOutput(mode gocudnn.PoolingMode, nan gocudnn.NANProp, window, padding, stride []int32) (*Layer, error)

SetupNoOutput will setup the pooling layer but not provide an output

func SetupNoOutputReverse

func SetupNoOutputReverse(mode gocudnn.PoolingMode, nan gocudnn.NANProp, window, padding, stride []int32) (*Layer, error)

SetupNoOutputReverse will setup the pooling layer but not provide an output

func SetupReverse

func SetupReverse(handle *cudnn.Handler, mode gocudnn.PoolingMode, nan gocudnn.NANProp, input *layers.Tensor, window, padding, stride []int32) (*Layer, *layers.Tensor, error)

SetupReverse sets up a reverse pooling layer and returns a pointer to the struct. Scalars are set to the default alpha =1.0 and beta =0.0 for both fwd and bwd.

func (*Layer) BackProp

func (l *Layer) BackProp(handle *cudnn.Handler, x, dx, y, dy *layers.Tensor) error

BackProp performs the pooling backward propigation

func (*Layer) ForwardProp

func (l *Layer) ForwardProp(handle *cudnn.Handler, x, y *layers.Tensor) error

ForwardProp performs the pooling forward propigation

func (*Layer) GetOutputDims

func (l *Layer) GetOutputDims(input *layers.Tensor) ([]int32, error)

GetOutputDims returns the output dims considering the input

func (*Layer) MakeOutputLayerInference

func (l *Layer) MakeOutputLayerInference(handle *cudnn.Handler, input *layers.Tensor) (*layers.Tensor, error)

MakeOutputLayerInference makes the output inference IO which doesn't contain a volume for the deltas

func (*Layer) MakeOutputTensor

func (l *Layer) MakeOutputTensor(handle *cudnn.Handler, input *layers.Tensor) (*layers.Tensor, error)

MakeOutputTensor will make the outputlayer for you

func (*Layer) SetBackwardScalars

func (l *Layer) SetBackwardScalars(alpha, beta float64)

SetBackwardScalars will change the default bwd scalars to whatever is passed

func (*Layer) SetForwardScalars

func (l *Layer) SetForwardScalars(alpha, beta float64)

SetForwardScalars will change the default fwd scalars to whatever is passsed

type Settings

type Settings struct {
	Mode    gocudnn.PoolingMode `json:"mode,omitempty"`
	Nan     gocudnn.NANProp     `json:"nan,omitempty"`
	Managed bool                `json:"managed,omitempty"`
	Window  []int32             `json:"window,omitempty"`
	Padding []int32             `json:"padding,omitempty"`
	Stride  []int32             `json:"stride,omitempty"`
}

Settings contains all the info needed to build a pooing layer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL