layers

package
v0.0.0-...-2fe1034 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activation

type Activation struct {
	LayerBase
	// contains filtered or unexported fields
}

func NewActivation

func NewActivation(args ...interface{}) *Activation

func (*Activation) Bprop

func (n *Activation) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*Activation) ClassName

func (n *Activation) ClassName() string

func (*Activation) Configure

func (n *Activation) Configure(inObj InputObject)

func (*Activation) Fprop

func (n *Activation) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*Activation) Init

func (n *Activation) Init(self base.Object, args base.Args)

func (*Activation) String

func (n *Activation) String() string

type Affine

type Affine struct {
	CompoundLayer
}

func NewAffine

func NewAffine(args ...interface{}) *Affine

func (*Affine) Init

func (n *Affine) Init(args base.Args)

type BatchNorm

type BatchNorm struct {
	LayerBase
	// contains filtered or unexported fields
}

func NewBatchNorm

func NewBatchNorm(args ...interface{}) *BatchNorm

func (*BatchNorm) Allocate

func (n *BatchNorm) Allocate(sharedOutputs backends.Tensor, accumulateUpdates bool)

func (*BatchNorm) Bprop

func (n *BatchNorm) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

SKIPPED: @Layer.accumulates decorator in original code

This is 'accumulates' wrapper that manages accParam objects for layers
that use them - required for GAN networks only, not relevant at this stage

func (*BatchNorm) ClassName

func (n *BatchNorm) ClassName() string

func (*BatchNorm) Configure

func (n *BatchNorm) Configure(inObj InputObject)

func (*BatchNorm) Fprop

func (n *BatchNorm) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*BatchNorm) GetParams

func (n *BatchNorm) GetParams() []Param

func (*BatchNorm) Init

func (n *BatchNorm) Init(self base.Object, args base.Args)

func (*BatchNorm) InitParams

func (n *BatchNorm) InitParams(dim0 int)

func (*BatchNorm) ReadParams

func (n *BatchNorm) ReadParams(r ParamReader)

func (*BatchNorm) WriteParams

func (n *BatchNorm) WriteParams(w ParamWriter)

type Bias

type Bias struct {
	ParameterLayer
	// contains filtered or unexported fields
}

func NewBias

func NewBias(args ...interface{}) *Bias

func (*Bias) Bprop

func (n *Bias) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*Bias) ClassName

func (n *Bias) ClassName() string

func (*Bias) Configure

func (n *Bias) Configure(inObj InputObject)

func (*Bias) Fprop

func (n *Bias) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*Bias) Init

func (n *Bias) Init(self base.Object, args base.Args)

func (*Bias) String

func (n *Bias) String() string

type BranchNode

type BranchNode struct {
	LayerBase
}

func NewBranchNode

func NewBranchNode(args ...interface{}) *BranchNode

func (*BranchNode) Bprop

func (n *BranchNode) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*BranchNode) ClassName

func (n *BranchNode) ClassName() string

func (*BranchNode) Configure

func (n *BranchNode) Configure(inObj InputObject)

func (*BranchNode) Fprop

func (n *BranchNode) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*BranchNode) Init

func (n *BranchNode) Init(self base.Object, args base.Args)

func (*BranchNode) SetDeltas

func (n *BranchNode) SetDeltas(deltaBuffers *DeltasTree)

type Broadcast

type Broadcast struct {
	LayerContainer
}

func (*Broadcast) AllocateDeltas

func (n *Broadcast) AllocateDeltas(globalDeltas *DeltasTree)

func (*Broadcast) Configure

func (n *Broadcast) Configure(inObj InputObject)

func (*Broadcast) GetTerminal

func (n *Broadcast) GetTerminal() []Layer

func (*Broadcast) Init

func (n *Broadcast) Init(self base.Object, layers []LayerItem, args base.Args)

func (*Broadcast) NestDeltas

func (n *Broadcast) NestDeltas() bool

func (*Broadcast) SetDeltas

func (n *Broadcast) SetDeltas(deltaBuffers *DeltasTree)

type CompoundLayer

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

func (*CompoundLayer) AddPostfilterLayers

func (n *CompoundLayer) AddPostfilterLayers()

func (*CompoundLayer) Append

func (n *CompoundLayer) Append(layer Layer)

func (*CompoundLayer) Atom

func (n *CompoundLayer) Atom() Layer

func (*CompoundLayer) Init

func (n *CompoundLayer) Init(args base.Args)

func (*CompoundLayer) InitBaseName

func (n *CompoundLayer) InitBaseName()

func (*CompoundLayer) Layers

func (n *CompoundLayer) Layers() []Layer

func (*CompoundLayer) List

func (n *CompoundLayer) List() []Layer

func (*CompoundLayer) ToCompoundLayer

func (n *CompoundLayer) ToCompoundLayer() *CompoundLayer

type Conv

type Conv struct {
	CompoundLayer
}

func NewConv

func NewConv(args ...interface{}) *Conv

func (*Conv) Init

func (n *Conv) Init(args base.Args)

type Convolution

type Convolution struct {
	ParameterLayer
	// contains filtered or unexported fields
}

func NewConvolution

func NewConvolution(args ...interface{}) *Convolution

func (*Convolution) Bprop

func (n *Convolution) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

SKIPPED: @Layer.accumulates decorator in original code

This is 'accumulates' wrapper that manages accParam objects for layers
that use them - required for GAN networks only, not relevant at this stage

func (*Convolution) ClassName

func (n *Convolution) ClassName() string

func (*Convolution) Configure

func (n *Convolution) Configure(inObj InputObject)

func (*Convolution) Fprop

func (n *Convolution) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*Convolution) Init

func (n *Convolution) Init(self base.Object, args base.Args)

func (*Convolution) String

func (n *Convolution) String() string

type Cost

type Cost interface {
	base.Object
	CostFunc() transforms.Cost
	Outputs() []backends.Tensor
	Deltas() []backends.Tensor
	Initialize(inObj Layer)
	GetCost(inputs []backends.Tensor, targets []backends.Tensor) backends.Value
	GetErrors(inputs []backends.Tensor, targets []backends.Tensor) []backends.Tensor
}

type DataTransform

type DataTransform struct {
	LayerBase
	// contains filtered or unexported fields
}

func NewDataTransform

func NewDataTransform(args ...interface{}) *DataTransform

func (*DataTransform) Bprop

func (n *DataTransform) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*DataTransform) ClassName

func (n *DataTransform) ClassName() string

func (*DataTransform) Configure

func (n *DataTransform) Configure(inObj InputObject)

func (*DataTransform) Fprop

func (n *DataTransform) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*DataTransform) Init

func (n *DataTransform) Init(self base.Object, args base.Args)

func (*DataTransform) String

func (n *DataTransform) String() string

type Deconv

type Deconv struct {
	CompoundLayer
}

func NewDeconv

func NewDeconv(args ...interface{}) *Deconv

func (*Deconv) Init

func (n *Deconv) Init(args base.Args)

type Deconvolution

type Deconvolution struct {
	ParameterLayer
	// contains filtered or unexported fields
}

func NewDeconvolution

func NewDeconvolution(args ...interface{}) *Deconvolution

func (*Deconvolution) Bprop

func (n *Deconvolution) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*Deconvolution) ClassName

func (n *Deconvolution) ClassName() string

func (*Deconvolution) Configure

func (n *Deconvolution) Configure(inObj InputObject)

func (*Deconvolution) Fprop

func (n *Deconvolution) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*Deconvolution) Init

func (n *Deconvolution) Init(self base.Object, args base.Args)

func (*Deconvolution) String

func (n *Deconvolution) String() string

type DeltasTree

type DeltasTree struct {
	base.Object
	// contains filtered or unexported fields
}

func NewDeltasTree

func NewDeltasTree(parent *DeltasTree) *DeltasTree

func (*DeltasTree) AllocateBuffers

func (t *DeltasTree) AllocateBuffers()

func (*DeltasTree) Ascend

func (t *DeltasTree) Ascend() *DeltasTree

func (*DeltasTree) Descend

func (t *DeltasTree) Descend() *DeltasTree

func (*DeltasTree) Init

func (t *DeltasTree) Init(parent *DeltasTree)

func (*DeltasTree) ProcLayer

func (t *DeltasTree) ProcLayer(layer Layer)

func (*DeltasTree) ReverseBuffers

func (t *DeltasTree) ReverseBuffers()

type Dropout

type Dropout struct {
	LayerBase
	// contains filtered or unexported fields
}

func NewDropout

func NewDropout(args ...interface{}) *Dropout

func (*Dropout) Allocate

func (n *Dropout) Allocate(sharedOutputs backends.Tensor, accumulateUpdates bool)

func (*Dropout) Bprop

func (n *Dropout) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*Dropout) ClassName

func (n *Dropout) ClassName() string

func (*Dropout) Configure

func (n *Dropout) Configure(inObj InputObject)

func (*Dropout) Fprop

func (n *Dropout) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*Dropout) Init

func (n *Dropout) Init(self base.Object, args base.Args)

func (*Dropout) String

func (n *Dropout) String() string

type GeneralizedCost

type GeneralizedCost struct {
	base.ObjectBase
	// contains filtered or unexported fields
}

func NewGeneralizedCost

func NewGeneralizedCost(args ...interface{}) *GeneralizedCost

func (*GeneralizedCost) ClassName

func (n *GeneralizedCost) ClassName() string

func (*GeneralizedCost) CostFunc

func (n *GeneralizedCost) CostFunc() transforms.Cost

func (*GeneralizedCost) Deltas

func (n *GeneralizedCost) Deltas() []backends.Tensor

func (*GeneralizedCost) GetCost

func (n *GeneralizedCost) GetCost(
	inputs []backends.Tensor, targets []backends.Tensor) backends.Value

func (*GeneralizedCost) GetErrors

func (n *GeneralizedCost) GetErrors(
	inputs []backends.Tensor, targets []backends.Tensor) []backends.Tensor

func (*GeneralizedCost) Init

func (n *GeneralizedCost) Init(self base.Object, args base.Args)

func (*GeneralizedCost) Initialize

func (n *GeneralizedCost) Initialize(inObj Layer)

func (*GeneralizedCost) Outputs

func (n *GeneralizedCost) Outputs() []backends.Tensor

type GeneralizedCostMask

type GeneralizedCostMask struct {
	GeneralizedCost
	// contains filtered or unexported fields
}

func NewGeneralizedCostMask

func NewGeneralizedCostMask(args ...interface{}) *GeneralizedCostMask

func (*GeneralizedCostMask) ClassName

func (n *GeneralizedCostMask) ClassName() string

func (*GeneralizedCostMask) GetCost

func (n *GeneralizedCostMask) GetCost(
	inputs []backends.Tensor, targets []backends.Tensor) backends.Value

func (*GeneralizedCostMask) GetErrors

func (n *GeneralizedCostMask) GetErrors(
	inputs []backends.Tensor, targets []backends.Tensor) []backends.Tensor

func (*GeneralizedCostMask) Init

func (n *GeneralizedCostMask) Init(self base.Object, args base.Args)

type InputObject

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

func MakeInputObject

func MakeInputObject(obj interface{}) InputObject

func (InputObject) AssertSingle

func (o InputObject) AssertSingle()

func (InputObject) IsNil

func (o InputObject) IsNil() bool

func (InputObject) Layer

func (o InputObject) Layer() Layer

func (InputObject) MultiShape

func (o InputObject) MultiShape() [][]int

func (InputObject) Shape

func (o InputObject) Shape() []int

type LRN

type LRN struct {
	LayerBase
	// contains filtered or unexported fields
}

func NewLRN

func NewLRN(args ...interface{}) *LRN

func (*LRN) Allocate

func (n *LRN) Allocate(sharedOutputs backends.Tensor, accumulateUpdates bool)

func (*LRN) Bprop

func (n *LRN) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*LRN) ClassName

func (n *LRN) ClassName() string

func (*LRN) Configure

func (n *LRN) Configure(inObj InputObject)

func (*LRN) Fprop

func (n *LRN) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*LRN) Init

func (n *LRN) Init(self base.Object, args base.Args)

type Layer

type Layer interface {
	base.Object
	Outputs() []backends.Tensor
	HasParams() bool
	OwnsOutput() bool
	Deltas() []backends.Tensor
	PrevLayer() Layer
	InShape() []int
	OutShape() []int
	MultiOutShape() [][]int
	String() string
	NestedStr(level int) string
	Configure(inObj InputObject)
	Allocate(sharedOutputs backends.Tensor, accumulateUpdates bool)
	AllocateDeltas(globalDeltas *DeltasTree)
	SetDeltas(deltaBuffers *DeltasTree)
	SetNext(layer Layer)
	GetParams() []Param
	Fprop(inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor
	Bprop(errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor
	GetTerminal() []Layer
	NestDeltas() bool
	BatchSum() backends.Tensor
	ReadParams(r ParamReader)
	WriteParams(w ParamWriter)
}

type LayerBase

type LayerBase struct {
	base.ObjectBase
	// contains filtered or unexported fields
}

func (*LayerBase) Allocate

func (n *LayerBase) Allocate(sharedOutputs backends.Tensor, accumulateUpdates bool)

func (*LayerBase) AllocateDeltas

func (n *LayerBase) AllocateDeltas(globalDeltas *DeltasTree)

func (*LayerBase) Atom

func (n *LayerBase) Atom() Layer

func (*LayerBase) BatchSum

func (n *LayerBase) BatchSum() backends.Tensor

func (*LayerBase) Configure

func (n *LayerBase) Configure(inObj InputObject)

func (*LayerBase) Deltas

func (n *LayerBase) Deltas() []backends.Tensor

func (*LayerBase) GetParams

func (n *LayerBase) GetParams() []Param

func (*LayerBase) GetTerminal

func (n *LayerBase) GetTerminal() []Layer

func (*LayerBase) HasParams

func (n *LayerBase) HasParams() bool

func (*LayerBase) InShape

func (n *LayerBase) InShape() []int

func (*LayerBase) Init

func (n *LayerBase) Init(self base.Object, args base.Args)

func (*LayerBase) List

func (n *LayerBase) List() []Layer

func (*LayerBase) MultiOutShape

func (n *LayerBase) MultiOutShape() [][]int

func (*LayerBase) NestDeltas

func (n *LayerBase) NestDeltas() bool

func (*LayerBase) NestedStr

func (n *LayerBase) NestedStr(level int) string

func (*LayerBase) OutShape

func (n *LayerBase) OutShape() []int

func (*LayerBase) Outputs

func (n *LayerBase) Outputs() []backends.Tensor

func (*LayerBase) OwnsOutput

func (n *LayerBase) OwnsOutput() bool

func (*LayerBase) PrevLayer

func (n *LayerBase) PrevLayer() Layer

func (*LayerBase) ReadParams

func (n *LayerBase) ReadParams(r ParamReader)

func (*LayerBase) SetDeltas

func (n *LayerBase) SetDeltas(deltaBuffers *DeltasTree)

func (*LayerBase) SetNext

func (n *LayerBase) SetNext(layer Layer)

func (*LayerBase) String

func (n *LayerBase) String() string

func (*LayerBase) ToLayer

func (n *LayerBase) ToLayer() Layer

func (*LayerBase) WriteParams

func (n *LayerBase) WriteParams(w ParamWriter)

type LayerContainer

type LayerContainer struct {
	LayerBase
	// contains filtered or unexported fields
}

func (*LayerContainer) Init

func (n *LayerContainer) Init(self base.Object, args base.Args)

func (*LayerContainer) Layers

func (n *LayerContainer) Layers() []Layer

func (*LayerContainer) LayersToOptimize

func (n *LayerContainer) LayersToOptimize() []Layer

func (*LayerContainer) NestedStr

func (n *LayerContainer) NestedStr(level int) string

func (*LayerContainer) ReadParams

func (n *LayerContainer) ReadParams(r ParamReader)

func (*LayerContainer) SetDeltas

func (n *LayerContainer) SetDeltas(deltaBuffers *DeltasTree)

func (*LayerContainer) ToLayerContainer

func (n *LayerContainer) ToLayerContainer() *LayerContainer

func (*LayerContainer) WriteParams

func (n *LayerContainer) WriteParams(w ParamWriter)

type LayerContainerTrait

type LayerContainerTrait interface {
	Layer
	Layers() []Layer
	LayersToOptimize() []Layer
	ToLayerContainer() *LayerContainer
}

type LayerItem

type LayerItem interface {
	Atom() Layer
	List() []Layer
}

type Linear

type Linear struct {
	ParameterLayer
	// contains filtered or unexported fields
}

func NewLinear

func NewLinear(args ...interface{}) *Linear

func (*Linear) Bprop

func (n *Linear) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

SKIPPED: @Layer.accumulates decorator in original code

This is 'accumulates' wrapper that manages accParam objects for layers
that use them - required for GAN networks only, not relevant at this stage

func (*Linear) ClassName

func (n *Linear) ClassName() string

func (*Linear) Configure

func (n *Linear) Configure(inObj InputObject)

func (*Linear) Fprop

func (n *Linear) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*Linear) Init

func (n *Linear) Init(self base.Object, args base.Args)

func (*Linear) String

func (n *Linear) String() string

type Merge

type Merge int
const (
	MergeRecurrent Merge = iota
	MergeDepth
	MergeStack
)

type MergeBroadcast

type MergeBroadcast struct {
	Broadcast
	// contains filtered or unexported fields
}

func NewMergeBroadcast

func NewMergeBroadcast(layers []LayerItem, args ...interface{}) *MergeBroadcast

func (*MergeBroadcast) Allocate

func (n *MergeBroadcast) Allocate(sharedOutputs backends.Tensor, accumulateUpdates bool)

func (*MergeBroadcast) Bprop

func (n *MergeBroadcast) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*MergeBroadcast) ClassName

func (n *MergeBroadcast) ClassName() string

func (*MergeBroadcast) Configure

func (n *MergeBroadcast) Configure(inObj InputObject)

func (*MergeBroadcast) Fprop

func (n *MergeBroadcast) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*MergeBroadcast) Init

func (n *MergeBroadcast) Init(self base.Object, layers []LayerItem, args base.Args)

type MergeMultiStream

type MergeMultiStream struct {
	MergeBroadcast
}

func NewMergeMultiStream

func NewMergeMultiStream(layers []LayerItem, args ...interface{}) *MergeMultiStream

func (*MergeMultiStream) Bprop

func (n *MergeMultiStream) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*MergeMultiStream) ClassName

func (n *MergeMultiStream) ClassName() string

func (*MergeMultiStream) Configure

func (n *MergeMultiStream) Configure(inObj InputObject)

func (*MergeMultiStream) Fprop

func (n *MergeMultiStream) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*MergeMultiStream) Init

func (n *MergeMultiStream) Init(self base.Object, layers []LayerItem, args base.Args)

func (*MergeMultiStream) NestDeltas

func (n *MergeMultiStream) NestDeltas() bool

func (*MergeMultiStream) SetDeltas

func (n *MergeMultiStream) SetDeltas(deltaBuffers *DeltasTree)

type MergeSum

type MergeSum struct {
	Broadcast
}

func NewMergeSum

func NewMergeSum(layers []LayerItem, args ...interface{}) *MergeSum

func (*MergeSum) Allocate

func (n *MergeSum) Allocate(sharedOutputs backends.Tensor, accumulateUpdates bool)

func (*MergeSum) Bprop

func (n *MergeSum) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*MergeSum) ClassName

func (n *MergeSum) ClassName() string

func (*MergeSum) Configure

func (n *MergeSum) Configure(inObj InputObject)

func (*MergeSum) Fprop

func (n *MergeSum) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*MergeSum) Init

func (n *MergeSum) Init(self base.Object, layers []LayerItem, args base.Args)

type Multicost

type Multicost struct {
	base.ObjectBase
	// contains filtered or unexported fields
}

func NewMulticost

func NewMulticost(costs []Cost, args ...interface{}) *Multicost

func (*Multicost) ClassName

func (n *Multicost) ClassName() string

func (*Multicost) CostFunc

func (n *Multicost) CostFunc() transforms.Cost

func (*Multicost) Deltas

func (n *Multicost) Deltas() []backends.Tensor

func (*Multicost) GetCost

func (n *Multicost) GetCost(inputs []backends.Tensor, targets []backends.Tensor) backends.Value

func (*Multicost) GetErrors

func (n *Multicost) GetErrors(
	inputs []backends.Tensor, targets []backends.Tensor) []backends.Tensor

func (*Multicost) Init

func (n *Multicost) Init(self base.Object, costs []Cost, args base.Args)

func (*Multicost) Initialize

func (n *Multicost) Initialize(inObj Layer)

func (*Multicost) Outputs

func (n *Multicost) Outputs() []backends.Tensor

type Param

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

func (*Param) Dw

func (p *Param) Dw() backends.Tensor

func (*Param) SetStates

func (p *Param) SetStates(states []backends.Tensor)

func (*Param) States

func (p *Param) States() []backends.Tensor

func (*Param) W

func (p *Param) W() backends.Tensor

type ParamReader

type ParamReader interface {
	Read(x backends.Tensor)
}

type ParamWriter

type ParamWriter interface {
	Write(x backends.Tensor)
}

type ParameterLayer

type ParameterLayer struct {
	LayerBase
	// contains filtered or unexported fields
}

func (*ParameterLayer) Allocate

func (n *ParameterLayer) Allocate(sharedOutputs backends.Tensor, accumulateUpdates bool)

func (*ParameterLayer) BatchSum

func (n *ParameterLayer) BatchSum() backends.Tensor

func (*ParameterLayer) GetParams

func (n *ParameterLayer) GetParams() []Param

func (*ParameterLayer) Init

func (n *ParameterLayer) Init(self base.Object, args base.Args)

func (*ParameterLayer) InitParams

func (n *ParameterLayer) InitParams(shape []int)

func (*ParameterLayer) ReadParams

func (n *ParameterLayer) ReadParams(r ParamReader)

func (*ParameterLayer) WriteParams

func (n *ParameterLayer) WriteParams(w ParamWriter)

type Pooling

type Pooling struct {
	LayerBase
	// contains filtered or unexported fields
}

func NewPooling

func NewPooling(args ...interface{}) *Pooling

func (*Pooling) Bprop

func (n *Pooling) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*Pooling) ClassName

func (n *Pooling) ClassName() string

func (*Pooling) Configure

func (n *Pooling) Configure(inObj InputObject)

func (*Pooling) Fprop

func (n *Pooling) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*Pooling) Init

func (n *Pooling) Init(self base.Object, args base.Args)

func (*Pooling) SetDeltas

func (n *Pooling) SetDeltas(deltaBuffers *DeltasTree)

type Reshape

type Reshape struct {
	LayerBase
	// contains filtered or unexported fields
}

func NewReshape

func NewReshape(args ...interface{}) *Reshape

func (*Reshape) Bprop

func (n *Reshape) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*Reshape) ClassName

func (n *Reshape) ClassName() string

func (*Reshape) Configure

func (n *Reshape) Configure(inObj InputObject)

func (*Reshape) Fprop

func (n *Reshape) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*Reshape) Init

func (n *Reshape) Init(self base.Object, args base.Args)

func (*Reshape) String

func (n *Reshape) String() string

type Sequential

type Sequential struct {
	LayerContainer
	// contains filtered or unexported fields
}

func NewSequential

func NewSequential(layers []LayerItem, args ...interface{}) *Sequential

func (*Sequential) Allocate

func (n *Sequential) Allocate(sharedOutputs backends.Tensor, accumulateUpdates bool)

func (*Sequential) AllocateDeltas

func (n *Sequential) AllocateDeltas(globalDeltas *DeltasTree)

func (*Sequential) Bprop

func (n *Sequential) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*Sequential) ClassName

func (n *Sequential) ClassName() string

func (*Sequential) Configure

func (n *Sequential) Configure(inObj InputObject)

func (*Sequential) Fprop

func (n *Sequential) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*Sequential) GetTerminal

func (n *Sequential) GetTerminal() []Layer

func (*Sequential) Init

func (n *Sequential) Init(self base.Object, layers []LayerItem, args base.Args)

func (*Sequential) ToSequential

func (n *Sequential) ToSequential() *Sequential

type SequentialTrait

type SequentialTrait interface {
	LayerContainerTrait
	ToSequential() *Sequential
}

type SingleOutputTree

type SingleOutputTree struct {
	Tree
}

func NewSingleOutputTree

func NewSingleOutputTree(layers []LayerItem, args ...interface{}) *SingleOutputTree

func (*SingleOutputTree) ClassName

func (n *SingleOutputTree) ClassName() string

func (*SingleOutputTree) Fprop

func (n *SingleOutputTree) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

type SkipNode

type SkipNode struct {
	LayerBase
}

func NewSkipNode

func NewSkipNode(args ...interface{}) *SkipNode

func (*SkipNode) Bprop

func (n *SkipNode) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*SkipNode) ClassName

func (n *SkipNode) ClassName() string

func (*SkipNode) Configure

func (n *SkipNode) Configure(inObj InputObject)

func (*SkipNode) Fprop

func (n *SkipNode) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*SkipNode) Init

func (n *SkipNode) Init(self base.Object, args base.Args)

type States

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

func NewStates

func NewStates() *States

func (*States) Get

func (s *States) Get() []backends.Tensor

func (*States) Set

func (s *States) Set(states []backends.Tensor)

type Tree

type Tree struct {
	LayerContainer
	// contains filtered or unexported fields
}

func NewTree

func NewTree(layers []LayerItem, args ...interface{}) *Tree

func (*Tree) Allocate

func (n *Tree) Allocate(sharedOutputs backends.Tensor, accumulateUpdates bool)

func (*Tree) AllocateDeltas

func (n *Tree) AllocateDeltas(globalDeltas *DeltasTree)

func (*Tree) Bprop

func (n *Tree) Bprop(
	errors []backends.Tensor, alpha float64, beta float64) []backends.Tensor

func (*Tree) ClassName

func (n *Tree) ClassName() string

func (*Tree) Configure

func (n *Tree) Configure(inObj InputObject)

func (*Tree) Fprop

func (n *Tree) Fprop(
	inputs []backends.Tensor, inference bool, beta float64) []backends.Tensor

func (*Tree) GetTerminal

func (n *Tree) GetTerminal() []Layer

func (*Tree) Init

func (n *Tree) Init(self base.Object, layers []LayerItem, args base.Args)

func (*Tree) MultiOutShape

func (n *Tree) MultiOutShape() [][]int

func (*Tree) NestedStr

func (n *Tree) NestedStr(level int) string

Jump to

Keyboard shortcuts

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