Skip to content

Qiskit Machine Learning 0.3.1

Compare
Choose a tag to compare
@manoelmarques manoelmarques released this 17 Feb 23:18
· 5 commits to stable/0.3 since this release
e927a48

Changelog

Upgrade Notes

  • Added support for running with Python 3.10. At the the time of the release, Torch didn’t have a python 3.10 version.

Bug Fixes

  • Fixes in Ad Hoc dataset. Fixed an ValueError when n=3 is passed to ad_hoc_data. When the value of n is not 2 or 3, a ValueError is raised with a message that the only supported values of n are 2 and 3.

  • Previously, VQC would throw an error if trained on batches of data where not all of the target labels that can be found in the full dataset were present. This is because VQC interpreted the number of unique targets in the current batch as the number of classes. Currently, VQC is hard-coded to expect one-hot-encoded targets. Therefore, VQC will now determine the number of classes from the shape of the target array.

  • Fixes an issue where VQC could not be trained on multiclass datasets. It returned nan values on some iterations. This is fixed in 2 ways. First, the default parity function is now guaranteed to be able to assign at least one output bitstring to each class, so long as 2**N >= C where N is the number of output qubits and C is the number of classes. This guarantees that it is at least possible for every class to be predicted with a non-zero probability. Second, even with this change it is still possible that on a given training instance a class is predicted with 0 probability. Previously this could lead to nan in the CrossEntropyLoss calculation. We now replace 0 probabilities with a small positive value to ensure the loss cannot return nan.

  • Fixes an issue where VQC would fail with warm_start=True. The extraction of the initial_point in TrainableModel from the final point of the minimization had not been updated to reflect the refactor of optimizers in qiskit-terra; the old optimize method, that returned a tuple was deprecated and new method minimize was created that returns an OptimizerResult object. We now correctly recover the final point of the minimization from previous fits to use for a warm start in subsequent fits.