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.
DiscriminatorNode¶
- class DiscriminatorNode(discriminators, validate=True)[source]¶
A class to discriminate kerneled data, e.g., IQ data, to produce counts.
This node integrates into the data processing chain a serializable
BaseDiscriminator
subclass instance which must have apredict()
method that takes as input a list of lists and returns a list of labels. Crucially, this node can be initialized with a single discriminator which applies to each memory slot or it can be initialized with a list of discriminators, i.e., one for each slot.Note
Future versions may see this class become a sub-class of
TrainableDataAction
.Note
This node will drop uncertainty from unclassified nodes. Returned labels don’t have uncertainty.
Initialize the node with an object that can discriminate.
- Parameters:
discriminators (BaseDiscriminator | List[BaseDiscriminator]) – The entity that will perform the discrimination. This needs to be a
BaseDiscriminator
or a list thereof that takes as input a list of lists and returns a list of labels. If a list of discriminators is given then there should be as many discriminators as there will be slots in the memory. The discriminator at the i-th index will be applied to the i-th memory slot.validate (bool) – If set to False the DataAction will not validate its input.
Methods
- __call__(data)¶
Call the data action of this node on the data.
- Parameters:
data (ndarray) – A numpy array with arbitrary dtype. If the elements are ufloat objects consisting of a nominal value and a standard error, then the error propagation is done automatically.
- Returns:
The processed data.
- Return type:
ndarray