Skip to content

nn.gates.activation

fn elu_gate #

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

fn gelu_gate #

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

fn leaky_relu_gate #

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

fn mish_gate #

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

fn relu_gate #

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

fn sigmoid_gate #

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

fn softmax_gate #

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

fn swish_gate #

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

fn tanh_gate #

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

fn (EluGate[T]) backward #

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

fn (EluGate[T]) cache #

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

fn (GELUGate[T]) backward #

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

fn (GELUGate[T]) cache #

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

fn (LeakyReluGate[T]) backward #

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

fn (LeakyReluGate[T]) cache #

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

fn (MishGate[T]) backward #

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

fn (MishGate[T]) cache #

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

fn (ReLUGate[T]) backward #

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

fn (ReLUGate[T]) cache #

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

fn (SigmoidGate[T]) backward #

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

fn (SigmoidGate[T]) cache #

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

fn (SoftmaxGate[T]) backward #

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

fn (SoftmaxGate[T]) cache #

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

fn (SwishGate[T]) backward #

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

fn (SwishGate[T]) cache #

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

fn (TanhGate[T]) backward #

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

fn (TanhGate[T]) cache #

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

struct EluGate #

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

struct GELUGate #

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

struct LeakyReluGate #

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

struct MishGate #

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

struct ReLUGate #

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

struct SigmoidGate #

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

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 }
}

struct TanhGate #

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