ott.neural.networks.velocity_field.VelocityField.time_encoder

ott.neural.networks.velocity_field.VelocityField.time_encoder#

VelocityField.time_encoder(n_freqs=128)#

Encode time \(t\) into a cyclical representation.

Time \(t\) is encoded as \(cos(\hat{t})\) and \(sin(\hat{t})\) where \(\hat{t} = [2\pi t, 2\pi 2 t,\dots, 2\pi n_f t]\).

Parameters:
  • t (Array) – Time of shape [n, 1].

  • n_freqs (int) – Frequency \(n_f\) of the cyclical encoding.

Return type:

Array

Returns:

Encoded time of shape [n, 2 * n_freqs].