Skip to content

nn.gates.activation

fn elu_gate #

fn elu_gate[T](cache &vtl.Tensor[T], alpha T) &EluGate[T]

elu_gate exposes this operation as part of the public API.

fn gelu_gate #

fn gelu_gate[T](cache &vtl.Tensor[T]) &GELUGate[T]

gelu_gate exposes this operation as part of the public API.

fn leaky_relu_gate #

fn leaky_relu_gate[T](cache &vtl.Tensor[T], slope T) &LeakyReluGate[T]

leaky_relu_gate exposes this operation as part of the public API.

fn mish_gate #

fn mish_gate[T](cache &vtl.Tensor[T]) &MishGate[T]

mish_gate exposes this operation as part of the public API.

fn relu_gate #

fn relu_gate[T](cache &vtl.Tensor[T]) &ReLUGate[T]

relu_gate exposes this operation as part of the public API.

fn sigmoid_gate #

fn sigmoid_gate[T](cache &vtl.Tensor[T]) &SigmoidGate[T]

sigmoid_gate exposes this operation as part of the public API.

fn softmax_gate #

fn softmax_gate[T](input &vtl.Tensor[T], dim int) &SoftmaxGate[T]

softmax_gate exposes this operation as part of the public API.

fn swish_gate #

fn swish_gate[T](cache &vtl.Tensor[T]) &SwishGate[T]

swish_gate exposes this operation as part of the public API.

fn tanh_gate #

fn tanh_gate[T](cache &vtl.Tensor[T]) &TanhGate[T]

tanh_gate exposes this operation as part of the public API.

fn (EluGate[T]) backward #

fn (g &EluGate[T]) backward(payload &autograd.Payload[T]) ![]&vtl.Tensor[T]

backward exposes this operation as part of the public API.

fn (EluGate[T]) cache #

fn (g &EluGate[T]) cache(mut result autograd.Variable[T], args ...autograd.CacheParam) !

cache exposes this operation as part of the public API.

fn (GELUGate[T]) backward #

fn (g &GELUGate[T]) backward(payload &autograd.Payload[T]) ![]&vtl.Tensor[T]

backward exposes this operation as part of the public API.

fn (GELUGate[T]) cache #

fn (g &GELUGate[T]) cache(mut result autograd.Variable[T], args ...autograd.CacheParam) !

cache exposes this operation as part of the public API.

fn (LeakyReluGate[T]) backward #

fn (g &LeakyReluGate[T]) backward(payload &autograd.Payload[T]) ![]&vtl.Tensor[T]

backward exposes this operation as part of the public API.

fn (LeakyReluGate[T]) cache #

fn (g &LeakyReluGate[T]) cache(mut result autograd.Variable[T], args ...autograd.CacheParam) !

cache exposes this operation as part of the public API.

fn (MishGate[T]) backward #

fn (g &MishGate[T]) backward(payload &autograd.Payload[T]) ![]&vtl.Tensor[T]

backward exposes this operation as part of the public API.

fn (MishGate[T]) cache #

fn (g &MishGate[T]) cache(mut result autograd.Variable[T], args ...autograd.CacheParam) !

cache exposes this operation as part of the public API.

fn (ReLUGate[T]) backward #

fn (g &ReLUGate[T]) backward(payload &autograd.Payload[T]) ![]&vtl.Tensor[T]

backward exposes this operation as part of the public API.

fn (ReLUGate[T]) cache #

fn (g &ReLUGate[T]) cache(mut result autograd.Variable[T], args ...autograd.CacheParam) !

cache exposes this operation as part of the public API.

fn (SigmoidGate[T]) backward #

fn (g &SigmoidGate[T]) backward(payload &autograd.Payload[T]) ![]&vtl.Tensor[T]

backward exposes this operation as part of the public API.

fn (SigmoidGate[T]) cache #

fn (g &SigmoidGate[T]) cache(mut result autograd.Variable[T], args ...autograd.CacheParam) !

cache exposes this operation as part of the public API.

fn (SoftmaxGate[T]) backward #

fn (g &SoftmaxGate[T]) backward(payload &autograd.Payload[T]) ![]&vtl.Tensor[T]

backward exposes this operation as part of the public API.

fn (SoftmaxGate[T]) cache #

fn (g &SoftmaxGate[T]) cache(mut result autograd.Variable[T], args ...autograd.CacheParam) !

cache exposes this operation as part of the public API.

fn (SwishGate[T]) backward #

fn (g &SwishGate[T]) backward(payload &autograd.Payload[T]) ![]&vtl.Tensor[T]

backward exposes this operation as part of the public API.

fn (SwishGate[T]) cache #

fn (g &SwishGate[T]) cache(mut result autograd.Variable[T], args ...autograd.CacheParam) !

cache exposes this operation as part of the public API.

fn (TanhGate[T]) backward #

fn (g &TanhGate[T]) backward(payload &autograd.Payload[T]) ![]&vtl.Tensor[T]

backward exposes this operation as part of the public API.

fn (TanhGate[T]) cache #

fn (g &TanhGate[T]) cache(mut result autograd.Variable[T], args ...autograd.CacheParam) !

cache exposes this operation as part of the public API.

struct EluGate #

struct EluGate[T] {
pub:
	cache &vtl.Tensor[T] = unsafe { nil }
	alpha T
}

EluGate defines a public data structure for this module.

struct GELUGate #

struct GELUGate[T] {
pub:
	cache &vtl.Tensor[T] = unsafe { nil }
}

GELUGate defines a public data structure for this module.

struct LeakyReluGate #

struct LeakyReluGate[T] {
pub:
	cache &vtl.Tensor[T] = unsafe { nil }
	slope T
}

LeakyReluGate defines a public data structure for this module.

struct MishGate #

struct MishGate[T] {
pub:
	cache &vtl.Tensor[T] = unsafe { nil }
}

MishGate defines a public data structure for this module.

struct ReLUGate #

struct ReLUGate[T] {
pub:
	cache &vtl.Tensor[T] = unsafe { nil }
}

ReLUGate defines a public data structure for this module.

struct SigmoidGate #

struct SigmoidGate[T] {
pub:
	cache &vtl.Tensor[T] = unsafe { nil }
}

SigmoidGate defines a public data structure for this module.

struct SoftmaxGate #

struct SoftmaxGate[T] {
pub:
	input &vtl.Tensor[T] = unsafe { nil }
	dim   int
}

SoftmaxGate stores the input tensor and dim to compute jacobian on backward.

struct SwishGate #

struct SwishGate[T] {
pub:
	cache &vtl.Tensor[T] = unsafe { nil }
}

SwishGate defines a public data structure for this module.

struct TanhGate #

struct TanhGate[T] {
pub:
	cache &vtl.Tensor[T] = unsafe { nil }
}

TanhGate defines a public data structure for this module.