vindy.libraries package

Submodules

vindy.libraries.base_library module

class BaseLibrary[source]

Bases: ABC

Abstract class for feature libraries

abstractmethod get_names(x)[source]

Construct the names of the features for the input x.

Parameters:

x (array-like) – Input data.

Returns:

Feature names.

Return type:

list of str

vindy.libraries.exponential_library module

class ExponentialLibrary(coeff=[1])[source]

Bases: BaseLibrary

get_names(x)[source]

Construct features for the input x.

Parameters:

x (array-like) – Input data.

Returns:

Feature names in exponential form.

Return type:

list of str

vindy.libraries.force_library module

class ForceLibrary(functions=[tensorflow.sin, tensorflow.cos])[source]

Bases: BaseLibrary

get_names(x)[source]

Construct features for the input x.

Parameters:

x (array-like) – Input data.

Returns:

Feature names for force features.

Return type:

list of str

vindy.libraries.fourier_library module

class FourierLibrary(freqs=[1])[source]

Bases: BaseLibrary

get_names(x)[source]

Construct features for the input x.

Parameters:

x (array-like) – Input data.

Returns:

Feature names for Fourier features.

Return type:

list of str

vindy.libraries.polynomial_library module

class PolynomialLibrary(degree=3, x_dim=2, interaction=True, include_bias=True)[source]

Bases: BaseLibrary

Polynomial library.

Parameters:
  • degree (int, default=3) – Polynomial degree.

  • x_dim (int, default=2) – Dimension of the input.

  • interaction (bool, default=True) – Include interaction terms.

  • include_bias (bool, default=True) – Include bias term.

__init__(degree=3, x_dim=2, interaction=True, include_bias=True)[source]

Polynomial library.

Parameters:
  • degree (int, default=3) – Polynomial degree.

  • x_dim (int, default=2) – Dimension of the input.

  • interaction (bool, default=True) – Include interaction terms.

  • include_bias (bool, default=True) – Include bias term.

get_names(x)[source]

Construct the names of the features for the input x.

Parameters:

x (array-like of shape (n_samples, 2*reduce_order)) – Latent variable and its time derivative.

Returns:

List of feature names.

Return type:

list of str

loop_rec(x, x_i, i, n, d)
loop_rec_names(x, x_i, i, n, d, l: list)[source]
Parameters:

l (list)

poly_higher_order(x)

Compute polynomial features for higher dimensional input x.

Parameters:

x (tf.Tensor) – Input tensor.

Returns:

x_poly – Polynomial features for higher dimensional input.

Return type:

tf.Tensor

Module contents