Note

This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.

TrainableDataAction

class TrainableDataAction(validate=True)[source]

A base class for data actions that need training.

Note

The parameters of trainable nodes computed during training should be listed in the class method TrainableDataAction._default_parameters(). These parameters are initialized at construction time and serialized together with the constructor arguments. All parameters defined in TrainableDataAction._default_parameters() should be assigned a None value to indicate that the node has not been trained.

Parameter values can be updated with the set_parameters() method and refer to using the TrainableDataAction.parameters() method. This is required to correctly JSON serialize and deserialize a trainable node with parameters set during training.

Create new node.

Parameters:

validate (bool) – If set to False the DataAction will not validate its input.

Attributes

TrainableDataAction.is_trained

Return False if the DataAction needs to be trained.

TrainableDataAction.parameters

Return the parameters of the trainable node.

Methods

TrainableDataAction.__call__(data)

Call the data action of this node on the data.

TrainableDataAction.set_parameters(**fields)

Set parameters for training.

TrainableDataAction.train(data)

Train a DataAction.

TrainableDataAction.__call__(data)

Call the data action of this node on the data.