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. You can install PRCpy using Poetry by adding it to your project's dependencies:

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.Pipeline_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
target_values = get_mackey_glass(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()

Contributing

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

Authors

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.3.tar.gz (109.4 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.3-py3-none-any.whl (90.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: prcpy-0.1.3.tar.gz
  • Upload date:
  • Size: 109.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.7 Windows/10

File hashes

Hashes for prcpy-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d40d7d8d031280d1f7b405703dcdc8d30fa2a211d704f76fa743e81672d86f7a
MD5 a10d351f7fcda87cf4a9974b5682ca53
BLAKE2b-256 abcc966525725954deb5fc6d1476b30f1b023b89beb5483fbcea52aec085e611

See more details on using hashes here.

File details

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

File metadata

  • Download URL: prcpy-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 90.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.9.7 Windows/10

File hashes

Hashes for prcpy-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f6f70c7b3f24ca93083d519f8f082a1d9df1fe153c29531d755499ac77c98bf3
MD5 b054fee52e4265d80fb079d38b311224
BLAKE2b-256 020e98beeef34fdb7d2a828977f4a0073eb46240f63d278e2a85118e5ab6d983

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