FeatureMapEmbedder

class kooplearn.torch.FeatureMapEmbedder(encoder: Module, decoder: Module = None, device: str | None = None)[source]

Bases: BaseEstimator, TransformerMixin

sklearn-style transformer wrapping a PyTorch encoder (and optional decoder).

Parameters:
  • encoder (torch.nn.Module) – Neural network mapping input data to latent space.

  • decoder (torch.nn.Module, optional) – Neural network mapping latent space back to input space.

  • device (str, optional) – Device for computation (‘cpu’ or ‘cuda’). Defaults to auto-detect.

Methods

fit(X=None, y=None)[source]

No fitting needed unless encoder/decoder are trainable elsewhere.

inverse_transform(Z: ndarray | Tensor) ndarray[source]

Decode data using the neural decoder, if available.

transform(X: ndarray | Tensor) ndarray[source]

Encode data using the neural encoder.