activation

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: BSD-2-Clause Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activation

type Activation int

Activation is the enumeration-like type used for the set of built-in activations.

const (
	Identity Activation = iota
	Tan
	Tanh
	Sigmoid
	HardSigmoid
	HardTanh
	Softsign
	ReLU
	CELU
	GELU
	ELU
	PositiveELU
	SwishB
	Swish
	SiLU
	Mish
	LeakyReLU
	SELU
	SoftPlus
	SoftShrink
	Threshold
	Softmax
	LogSoftmax
	SparseMax
)

func MustParseActivation added in v1.1.0

func MustParseActivation(str string) Activation

MustParseActivation maps a string to an activation function. It panics if the string does not match any built-in activation (not even using lowercase).

func ParseActivation added in v1.1.0

func ParseActivation(str string) (Activation, error)

ParseActivation maps a string to an activation function. It returns an error if the string does not match any built-in activation (not even using lowercase).

type Model

type Model struct {
	nn.Module
	Activation Activation
	Params     []*nn.Param
}

func New

func New(activation Activation, params ...*nn.Param) *Model

func (*Model) Forward

func (m *Model) Forward(xs ...mat.Tensor) []mat.Tensor

Jump to

Keyboard shortcuts

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