PositionalEnc

scalation.modeling.forecasting.neuralforecasting.PositionalEnc
trait PositionalEnc(m: Int, d: Int)

The PositionalEnc trait provides methods to convert a time t into an encoded vector. An encoded vector consists of numbers in [-1.0, 1.0]. It implements Absolute Fixed Vanilla Positional Encoding.

Value parameters

d

the dimensionality of the positional encoding (except for f0)

m

the length of the time series (number of time points)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def f0(t: Int): VectorD

Convert position/time t to an encoded vector (of length one) using Naive Positional Encoding. Also assumes t < m.

Convert position/time t to an encoded vector (of length one) using Naive Positional Encoding. Also assumes t < m.

Value parameters

t

the position/time-index to be encoded

Attributes

def f1(t: Int): VectorD

Convert position/time t to an encoded vector using Sinusoidal Positional Encoding. Note: works better for larger values of d as is common for NLP.

Convert position/time t to an encoded vector using Sinusoidal Positional Encoding. Note: works better for larger values of d as is common for NLP.

Value parameters

t

the position/time-index to be encoded

Attributes

def f2(t: Double): VectorD

Convert position/time t to an encoded vector using Length-Adjusted Sinusoidal Positional Encoding. Suggested for smaller values of d as is common for time series.

Convert position/time t to an encoded vector using Length-Adjusted Sinusoidal Positional Encoding. Suggested for smaller values of d as is common for time series.

Value parameters

t

the position/time-index to be encoded

Attributes