Snake

class Snake<T : DType, V>(val channels: Int, val name: String = "Snake", initAlpha: Tensor<T, V>? = null) : Module<T, V> , ModuleParameters<T, V> (source)

Snake activation function: f(x) = x + sin²(α * x) / α

Used in audio synthesis models (BigVGAN, Voxtral codec) where it provides periodic inductive bias that helps model audio waveforms.

Parameters

channels

Number of channels (for per-channel alpha)

name

Module name

initAlpha

Initial alpha parameter tensor (shape: channels)

Constructors

Link copied to clipboard
constructor(channels: Int, name: String = "Snake", initAlpha: Tensor<T, V>? = null)

Properties

Link copied to clipboard
Link copied to clipboard
open override val modules: List<Module<T, V>>
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val params: List<ModuleParameter<T, V>>

Parameters owned by this node (weights, biases, etc.).

Functions

Link copied to clipboard
open override fun forward(input: Tensor<T, V>, ctx: ExecutionContext): Tensor<T, V>