TransformerPipeline#

class TransformerPipeline(transformers, name=None)[source]#

Chain multiple transformers.

Given \(\tau\in\NN\) transformers \(\mathcal{T}_1,\ldots,\mathcal{T}_{\tau}\), this class defines the compositional transformer \(\mathcal{T} = \mathcal{T}_{\tau}\circ\cdots\circ\mathcal{T}_1\).

Parameters:
transformerstuple of instantiated Transformer objects

Transformers to be chained together; transformers[0] is applied first, then transformers[1], and so on.

namestr or None

Label for the state variable that this transformer acts on.

Notes

This class connects multiple transformers “horizontally”; see TransformerMulti to connect multiple transformers “vertically”, i.e., to assign different transformations for different parts of the state.

Properties:
name#

Label for the state variable that this transformer acts on.

num_transformers#

Number of transformers chained together.

state_dimension#

Dimension \(n\) of the state.

transformers#

Transformers being chained together; transformers[0] is applied first, then transformers[1], and so on.

Methods:

fit

Learn (but do not apply) the transformation.

fit_transform

Learn and apply the transformation.

inverse_transform

Apply the inverse of the learned transformation.

load

Load a previously saved transformer from an HDF5 file.

save

Save the transformer to an HDF5 file.

transform

Apply the learned transformation.

transform_ddts

Apply the learned transformation to snapshot time derivatives.

verify

Verify that transform() and inverse_transform() are consistent and that transform_ddts(), if implemented, is consistent with transform().