reshape

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: 5 Imported by: 1

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 is the that type that handles reshape methods

func Build

func Build(handle *cudnn.Handler, mode Mode, dtype gocudnn.DataType, window []int32, networkinput bool) (*Layer, error)

Build builds the layer mode picks the mode window has to be passed if S2B it is a set size that you want each batch to be. window will be ignored if mode was picked to transpose All will be ignored of you pick transform

func SetupB2S

func SetupB2S(handle *cudnn.Handler, window, stride []int32, networkinput bool) (*Layer, error)

SetupB2S sets up Batch 2 Shape layer. If networkinput is true the delta values will not be passed. Window decides how it will shape with respect to h and w. Window must be a factor of the batch. Example NCHW vector of [24,5,2,3]. If window of [4,3]. The vector output will be [2,5,8,9]. Placing batches is row dominant like in C.

func SetupS2B

func SetupS2B(handle *cudnn.Handler, window, stride []int32, networkinput bool) (*Layer, error)

SetupS2B sets up Shape 2 Batch layer. If networkinput is true the delta values will not be passed. Window decides how it will shape of the batches with h and w. The window doesn't need to be a factor of the input values. The last values will be zero Example NCHW vector of [2,5,8,8]. If window of [3,3]. The vector output will be [18,5,3,3]. Placing batches is row dominant like in C.

func (*Layer) BackProp

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

BackProp performs the backprop prop x is the input and output and y is the input

func (*Layer) ForwardProp

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

ForwardProp performs the forward prop x is the input and y is the input and output

func (*Layer) MakeOutputTensor

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

MakeOutputTensor returns a layer.IO for the network

func (*Layer) MakeOutputTensorInference

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

MakeOutputTensorInference makes the output tensor for inference

func (*Layer) MakeTranFormHelper

func (l *Layer) MakeTranFormHelper(x, y *layers.Tensor) (*TransFormHelper, error)

MakeTranFormHelper create a transformhelper

type Mode

type Mode int

Mode is a flag set for this layer

type ModeFlag

type ModeFlag struct {
}

ModeFlag passes flags for this layer through methods.

func (ModeFlag) B2S

func (l ModeFlag) B2S() Mode

B2S is batch to shape

func (ModeFlag) Resize

func (l ModeFlag) Resize() Mode

Resize sets layer mode to space to batch

func (ModeFlag) S2B

func (l ModeFlag) S2B() Mode

S2B sets layer mode to space to batch

func (ModeFlag) Transform

func (l ModeFlag) Transform() Mode

Transform performs the transform op

func (ModeFlag) Transpose

func (l ModeFlag) Transpose() Mode

Transpose sets layer mode to transpose

type TransFormHelper

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

TransFormHelper helps reshaping

Jump to

Keyboard shortcuts

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