Skip to main content

No project description provided

Project description

PRCpy: A Python Library for Physical Reservoir Computing

PRCpy is a Python package designed to ease experimental data processing for physical reservoir computing.

Features

  • Data handling and preprocessing.
  • Customizable data processing pipelines for various research needs.

Installation

PRCpy requires Python 3.9 or later.

Using pip

pip install prcpy

Using Poetry

poetry add prcpy

Note

Latest release is always recommended.

PIP: pip install prcpy --upgrade
POERTY: poetry update prcpy

General usage overview

  1. Define data path
  2. Define pre-processing parameters
  3. Create RC pipeline
  4. Define target and add to pipeline
  5. Define model for training
  6. Define RC parameters
  7. Run RC

Example:

import PRCpy

from prcpy.RC import Pipeline
from prcpy.TrainingModels.RegressionModels import define_Ridge
from prcpy.Maths.Target_functions import get_mackey_glass, get_square_waves

Define data directory and processing parameters

Note: Data files must contain "scan" in their file names. See examples/data for example data files.

data_dir_path = "your/data/path"
process_params = {
    "Xs": "Frequency",
    "Readouts": "Spectra",
    "remove_bg": True,
    "bg_fname": "background_data.txt",
    "smooth": False,
    "smooth_win": 51,
    "smooth_rank": 4,
    "cut_xs": False,
    "x1": 2,
    "x2": 5,
    "normalize": False,
    "sample": True,
    "sample_rate": 13
}

Create RC pipeline

rc_pipeline = Pipeline(data_dir_path, process_params)

Target generation

Transformation
period = 10
sample_spacing = rc_pipeline.get_sample_spacing(period)
target_values = get_square_waves(sample_spacing, period, norm=True)
Forecasting
mg_path = "mackey_glass_t17.npy"
target_values = get_npy_data(mg_path, norm=True)
Add target to pipeline
rc_pipeline.define_target(target_values)

Define model

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)

Define RC parameters

Set "tau": 0 for transformation.

rc_params = {
        "model": model,
        "tau": 10,
        "test_size": 0.3,
        "error_type": "MSE"
    }

Run RC

rc_pipeline.run()

Get results

results = rc_pipeline.get_rc_results()

Authors & Maintainers

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 Dr. Oscar Lee.

Research enquries

For collaborations or research enquires, please contact Prof. Hide Kurebayashi.

Find out more on PRC

PRCpy

RC publications from the group

Research articles

Review/perspectives

Outreach

Recent PRC publications

TBA.

Contributing

Any community contributions are welcome. Please refer to the project's GitHub repository for contribution guidelines.

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

prcpy-0.1.11.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prcpy-0.1.11-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file prcpy-0.1.11.tar.gz.

File metadata

  • Download URL: prcpy-0.1.11.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/10

File hashes

Hashes for prcpy-0.1.11.tar.gz
Algorithm Hash digest
SHA256 5872c632851c04fb55223ce13a91a4395a17dd62623a2be8e078ce97d6945fb8
MD5 eb1a49a5606015054618a8fd30bacdd0
BLAKE2b-256 87daea25ccbeaf8ee7fd8d5dbad2d598366af0dfb85d2e1dca676d54b2feb85b

See more details on using hashes here.

File details

Details for the file prcpy-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: prcpy-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.2 Windows/10

File hashes

Hashes for prcpy-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 6bd31083dfe7110b53d8f0db1ae57558f4341ed253050bb9c6a7e4d18e564812
MD5 005b78482d168f42a5138147ed6a8397
BLAKE2b-256 2002248208827a264bd119c87bd45e5d1fce7f73af60c4df9c5c13e4841927a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page