PRCpy is a Python package designed to ease experimental data processing for physical reservoir computing.
- Data handling and preprocessing.
- Customizable data processing pipelines for various research needs.
PRCpy requires Python 3.9 or later.
pip install prcpy
poetry add prcpy
Latest release is always recommended.
PIP: pip install prcpy --upgrade
POERTY: poetry update prcpy
Check your version by running:
prcpy.__version__
- Define data path
- Define pre-processing parameters
- Create RC pipeline
- Define target and add to pipeline
- Define model for training
- Define RC parameters
- Run RC
from prcpy.RC import Pipeline
from prcpy.TrainingModels.RegressionModels import define_Ridge
from prcpy.Maths.Target_functions import get_npy_data, generate_square_wave
Note: Data files must match the string specified by "prefix". See examples/data for example data files.
data_dir_path = "your/data/path"
prefix = "scan"
process_params = {
"Xs": "Frequency",
"Readouts": "Spectra",
"remove_bg": False,
"bg_fname": "background_data.txt",
"smooth": False,
"smooth_win": 51,
"smooth_rank": 4,
"cut_xs": False,
"x1": 2,
"x2": 5,
"normalize_local": False,
"normalize_global": False,
"sample": False,
"sample_rate": 13,
"transpose": False
}
rc_pipeline = Pipeline(data_dir_path, prefix, process_params)
num_periods = 10
length = rc_pipeline.get_df_length()
target_values = generate_square_wave(length,num_periods)
mg_path = "mackey_glass_t17.npy"
target_values = get_npy_data(mg_path, norm=True)
rc_pipeline.define_target(target_values)
model_params = {
"alpha": 1e-3,
"fit_intercept": True,
"copy_X": True,
"max_iter": None,
"tol": 0.0001,
"solver": "auto",
"positive": False,
"random_state": None,
}
model = define_Ridge(model_params)
Set "tau": 0
for transformation.
rc_params = {
"model": model,
"tau": 10,
"test_size": 0.3,
"error_type": "MSE"
}
rc_pipeline.run(rc_params)
results = rc_pipeline.get_rc_results()
rc_pipeline.define_input(target_values)
nl = rc_pipeline.get_non_linearity()
lmc = rc_pipeline.get_linear_memory_capacity()[0]
We are a neuromorphic computing division within the UCL Spintronics Group at London Centre for Nanotechnology, University College London, UK. For any queries about PRCpy, please contact Harry Youel (harry.youel.19@ucl.ac.uk) or Daniel Prestwood (daniel.prestwood.22@ucl.ac.uk).
For collaborations or research enquires, please contact Prof. Hide Kurebayashi.
- Refer to the PRCpy manual paper for detailed tutorial use of PRCpy.
- Please cite using use BibTex if you use PRCpy for any publications.
- Refer to PRCpy documentation [TBA] for detailed package documentation.
- Task-adaptive physical reservoir computing, O. Lee, et al., Nature Materials (2024).
- Neuromorphic overparameterisation and few-shot learning in multilayer physical neural networks, K. Stenning, et al., Nature Communications (2024).
- Reconfigurable training and reservoir computing in an artificial spin-vortex ice via spin-wave fingerprinting, J. Gartside, et al., Nature Nanotechnology (2022).
- Perspective on unconventional computing using magnetic skyrmions, O. Lee, et al., Applied Physics Letters (2023).
- Memristive, Spintronic, and 2D-Materials-Based Devices to Improve and Complement Computing Hardware, D. Joksas, et al., Advanced Intelligent Systems (2022).
- Physical reservoir computers that can adapt to perform different tasks, H. Kurebayashi, O. Lee, Nature Materials Research Briefing (2024).
TBA.
Any community contributions are welcome. Please refer to the project's GitHub repository for contribution guidelines.