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:Learn (but do not apply) the transformation.
Learn and apply the transformation.
Apply the inverse of the learned transformation.
Load a previously saved transformer from an HDF5 file.
Save the transformer to an HDF5 file.
Apply the learned transformation.
Apply the learned transformation to snapshot time derivatives.
Verify that
transform()
andinverse_transform()
are consistent and thattransform_ddts()
, if implemented, is consistent withtransform()
.