A quantum & classical reservoir handler for Temporal Series Prediction
Project description
NAREF
Neutral Atom Renewable Energy Forecasting
This file showcases quantum and classical reservoirs in a simple example.
import naref
from naref.classical.hyper import HyperC
from naref.quantum.hyper import HyperQ
from naref.quantum import QRC
from naref.classical import CRC
from naref import data
qrc = QRC(
sample_len=8,
nb_atoms=9,
N_samples=1024,
inp_duration=1000,
reset_rate=0,
geometry="grid_lattice_centred",
atom_distance=15,
input_type="mackey",
test_len=data.real_test_len,
train_len=data.real_train_len,
verbose=True)
qrc.build_model(data.mackey[:250], data.mackey[250:280])
qrc.show_test_prediction()
qrc.show_train_prediction()
qrc.get_error_train()
qrc.get_error_test()
Building Quantum Reservoir...
10 training steps finished, training time : 24.890s
20 training steps finished, training time : 24.411s
30 training steps finished, training time : 24.441s
40 training steps finished, training time : 25.471s
50 training steps finished, training time : 25.757s
60 training steps finished, training time : 25.194s
70 training steps finished, training time : 24.324s
80 training steps finished, training time : 24.378s
90 training steps finished, training time : 31.824s
100 training steps finished, training time : 29.980s
110 training steps finished, training time : 28.739s
120 training steps finished, training time : 27.935s
130 training steps finished, training time : 30.140s
140 training steps finished, training time : 31.482s
150 training steps finished, training time : 33.550s
160 training steps finished, training time : 33.109s
170 training steps finished, training time : 31.198s
180 training steps finished, training time : 32.346s
190 training steps finished, training time : 34.320s
200 training steps finished, training time : 37.271s
210 training steps finished, training time : 37.513s
220 training steps finished, training time : 33.800s
230 training steps finished, training time : 35.306s
240 training steps finished, training time : 34.594s
Training finished. Total training time: 731.384s
Train error (Mean absolute error regression loss): 5.165748453421183e-15
10 testing steps finished, testing time : 36.515s
20 testing steps finished, testing time : 34.390s
Test error (Mean absolute error regression loss): 0.014927562760331666
0.014927562760331666
crc = CRC(
sample_len=8,
nb_neurons=9)
crc.build_model(data.mackey[:250], data.mackey[250:280])
crc.show_test_prediction()
crc.show_train_prediction()
crc.get_error_test()
Building Classical Reservoir...
0.047504000683266046
crc.get_error_train()
0.05308248069948858
crc = CRC(
sample_len=8,
nb_neurons=15)
crc.build_model(data.mackey[:500], data.mackey[500:530])
crc.show_test_prediction()
crc.show_train_prediction()
crc.get_error_test()
Building Classical Reservoir...
0.009784391178625047
crc.get_error_train()
0.008250889994704327
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
naref-0.0.4.tar.gz
(18.3 kB
view details)
Built Distribution
naref-0.0.4-py3-none-any.whl
(21.4 kB
view details)
File details
Details for the file naref-0.0.4.tar.gz
.
File metadata
- Download URL: naref-0.0.4.tar.gz
- Upload date:
- Size: 18.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6441ad7e25e6acfbb2420bcc190f0501db1261406f754fac94d9be4e168d511e |
|
MD5 | c4a96e4b99b92145a2d4e3f75d2b1450 |
|
BLAKE2b-256 | 8a26882490ee65995a5844ec38fb51176430b9ffcceaf8c5f156b7643d2761ac |
File details
Details for the file naref-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: naref-0.0.4-py3-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8928d68d114d4003100af4203eaad78e0ac8659d065300167d518bf71fe14f4 |
|
MD5 | b5dd222aebf3551e09b724c1798fc554 |
|
BLAKE2b-256 | 0a585c36827298e5769bfeed9b003fc986ed7cafd65daad15c52a88cf70795fd |