vindy.callbacks package

Submodules

vindy.callbacks.pdf_threshold_callback module

class PDFThresholdCallback(*args: Any, **kwargs: Any)[source]

Bases: Callback

Callback for the VINDy layer to cancel coefficients based on PDF thresholding.

This callback sets all coefficients of the VINDy layer to zero if their corresponding probability density function at zero is above the threshold.

Parameters:
  • freq (int, default=1) – Frequency of coefficient cancellation (every freq-th epochs).

  • threshold (float, default=1) – Threshold for cancellation (coefficients with pdf(0) > threshold are zeroed).

  • on_train_end (bool, default=False) – Perform thresholding at end of training.

  • **kwargs – Additional keyword arguments passed to tf.keras.callbacks.Callback.

__init__(freq=1, threshold=1, on_train_end=False, **kwargs)[source]

Callback for the VINDy layer to cancel coefficients based on PDF thresholding.

This callback sets all coefficients of the VINDy layer to zero if their corresponding probability density function at zero is above the threshold.

Parameters:
  • freq (int, default=1) – Frequency of coefficient cancellation (every freq-th epochs).

  • threshold (float, default=1) – Threshold for cancellation (coefficients with pdf(0) > threshold are zeroed).

  • on_train_end (bool, default=False) – Perform thresholding at end of training.

  • **kwargs – Additional keyword arguments passed to tf.keras.callbacks.Callback.

cancel_coefficients()[source]

Cancel coefficients based on their probability density at zero.

Cancels the coefficients of the SINDy layer if their corresponding probability density function at zero is above the threshold, i.e., if pdf(0) > self.threshold.

on_epoch_end(epoch, logs=None)[source]
on_train_end(logs=None)[source]

vindy.callbacks.save_coefficients_callback module

class SaveCoefficientsCallback(*args: Any, **kwargs: Any)[source]

Bases: Callback

Callback for logging SINDy coefficients during training.

Parameters:
  • freq (int, default=1) – Frequency of saving the coefficients (every freq-th epoch).

  • **kwargs – Additional keyword arguments passed to tf.keras.callbacks.Callback.

__init__(freq=1, **kwargs)[source]

Callback for logging SINDy coefficients during training.

Parameters:
  • freq (int, default=1) – Frequency of saving the coefficients (every freq-th epoch).

  • **kwargs – Additional keyword arguments passed to tf.keras.callbacks.Callback.

on_epoch_end(epoch, logs=None)[source]

vindy.callbacks.spotify_callback module

class SpotifyCallback(*args: Any, **kwargs: Any)[source]

Bases: Callback

on_epoch_end(epoch, logs=None)[source]

vindy.callbacks.threshold_prune_callback module

class ThresholdPruneCallback(*args: Any, **kwargs: Any)[source]

Bases: Callback

Callback for thresholding SINDy coefficients during training.

This callback sets all coefficients of the SINDy layer to zero if their value is below a certain threshold.

Parameters:
  • freq (int, default=1) – Frequency of coefficient cancellation (every freq-th epochs).

  • threshold (float, default=0.01) – Threshold for cancellation (coefficients with |value| < threshold are zeroed).

  • on_train_end (bool, default=False) – Perform thresholding at end of training.

  • start_epoch (int, default=0) – First epoch for which the thresholding is applied.

__init__(freq=1, threshold=0.01, on_train_end=False, start_epoch=0)[source]

Callback for thresholding SINDy coefficients during training.

This callback sets all coefficients of the SINDy layer to zero if their value is below a certain threshold.

Parameters:
  • freq (int, default=1) – Frequency of coefficient cancellation (every freq-th epochs).

  • threshold (float, default=0.01) – Threshold for cancellation (coefficients with |value| < threshold are zeroed).

  • on_train_end (bool, default=False) – Perform thresholding at end of training.

  • start_epoch (int, default=0) – First epoch for which the thresholding is applied.

on_epoch_end(epoch, logs=None)[source]
on_train_end(logs=None)[source]
prune_weights()[source]

Module contents