For Generalization in QML from few training data Demo:
Training for different training set sizes cell: The following error is received.
AttributeError Traceback (most recent call last)
in <cell line: 22>()
20 # run training for multiple sizes
21 train_sizes = [2, 5, 10, 20, 40, 80]
—> 22 results_df = run_iterations(n_train=2)
23 for n_train in train_sizes[1:]:
24 results_df = pd.concat([results_df, run_iterations(n_train=n_train)])
12 frames
[… skipping hidden 20 frame]
[... skipping hidden 12 frame]
[... skipping hidden 3 frame]
/usr/local/lib/python3.10/dist-packages/jax/_src/deprecations.py in getattr(name)
51 warnings.warn(message, DeprecationWarning, stacklevel=2)
52 return fn
—> 53 raise AttributeError(f"module {module!r} has no attribute {name!r}")
54
55 return getattr
AttributeError: module ‘jax’ has no attribute ‘ad’
–
Name: PennyLane
Version: 0.31.1
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: GitHub - PennyLaneAI/pennylane: PennyLane is a cross-platform Python library for differentiable programming of quantum computers. Train a quantum computer the same way as a neural network.
Author:
Author-email:
License: Apache License 2.0
Location: /usr/local/lib/python3.10/dist-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, requests, rustworkx, scipy, semantic-version, toml, typing-extensions
Required-by: PennyLane-Lightning
Platform info: Linux-5.15.109±x86_64-with-glibc2.35
Python version: 3.10.12
Numpy version: 1.23.5
Scipy version: 1.10.1
Installed devices:
Thank you,
Reference: