Skip to main content

No project description provided

Project description

PRCpy: A Python Package for Processing of 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_npy_data, generate_square_waves

Define data directory and processing parameters

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": True,
    "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": True,
    "sample_rate": 13,
    "transpose": False
}

Create RC pipeline

rc_pipeline = Pipeline(data_dir_path, prefix, process_params)

Target generation

Transformation
num_periods = 10
length = rc_pipeline.get_df_length()
target_values = generate_square_wave(length,num_periods)
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 Harry Youel (harry.youel.19@ucl.ac.uk) or Daniel Prestwood (daniel.prestwood.22@ucl.ac.uk).

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.13.tar.gz (49.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.13-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: prcpy-0.1.13.tar.gz
  • Upload date:
  • Size: 49.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.5 Windows/10

File hashes

Hashes for prcpy-0.1.13.tar.gz
Algorithm Hash digest
SHA256 5a6c4dd3a1680bf5597c8899faca1953f6d9f23caa517349060c5173470bb392
MD5 336f206d6a2f061a717713b0c1bf766c
BLAKE2b-256 8989a86dc95dad5aab8ed1dba8dd73039fc7131b5f626aef221528554a926708

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prcpy-0.1.13-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.5 Windows/10

File hashes

Hashes for prcpy-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 f3b3977a8bd14ebdc7fe92914c582360215923dac770240d7a5a40ae0b707828
MD5 786a2da48748a72c00b00dafdcf06791
BLAKE2b-256 66ad3e4764523bd0f79ffaa43d20f999dfb8f46a96e76beb50bada8f1ace336a

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