A PyTorch implementation of a NARX neural network.
Project description
narxpy: PyTorch NARX Implementation
A simple, reusable PyTorch implementation of a Nonlinear Autoregressive Network with Exogenous Inputs (NARX).
Features
- Supports configurable input/output delays (
d_i,d_o). - Handles multi-dimensional exogenous (
x) and endogenous (y) time series. - Configurable hidden layer size and output activation function.
- Supports different simulation modes:
- Close Loop (Parallel): Uses own predictions for feedback (standard simulation/forecasting).
- Open Loop (Series-Parallel): Uses provided true values for feedback (teacher forcing, common for training).
- Includes optional bootstrapping for initializing close-loop simulations.
Installation
pip install narxpy
Usage
import torch
from narxpy import NARX
model = NARX(d_i=d_i, d_o=d_o, d_x=d_x, d_y=d_y, d_hl=d_hl, act_func=act_func)
# --- Run Modes ---
# 1. Close Loop (Simulation - Default)
y_pred_close = model(x_data, mode="close")
print(f"Close loop output shape: {y_pred_close.shape}")
# 2. Open Loop (Teacher Forcing)
y_pred_open = model(x_data, mode="open", y=y_true)
print(f"Open loop output shape: {y_pred_open.shape}")
# 3. Close Loop with Bootstrap
y_pred_bootstrap = model(x_data, mode="close", y=y_true, bootstrap=bootstrap_steps)
print(f"Bootstrap output shape: {y_pred_bootstrap.shape}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file narxpy-0.1.0.tar.gz.
File metadata
- Download URL: narxpy-0.1.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11698da8970cb274c6a397b017df18af7d76aa958dad0cf96b4edd6e428dbae7
|
|
| MD5 |
22ecb35d1d2b0e7096e1b132a02bd38d
|
|
| BLAKE2b-256 |
268903b371922a9403ea79a0507569be8ee854871ee17f0414236f7c9e0519bd
|
Provenance
The following attestation bundles were made for narxpy-0.1.0.tar.gz:
Publisher:
python-publish.yml on ilmarcopardo/NARX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
narxpy-0.1.0.tar.gz -
Subject digest:
11698da8970cb274c6a397b017df18af7d76aa958dad0cf96b4edd6e428dbae7 - Sigstore transparency entry: 199212489
- Sigstore integration time:
-
Permalink:
ilmarcopardo/NARX@d050c3b1da5849d7967bad7b2c5f740ce2d93901 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ilmarcopardo
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d050c3b1da5849d7967bad7b2c5f740ce2d93901 -
Trigger Event:
release
-
Statement type:
File details
Details for the file narxpy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: narxpy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1608eefecdf6918c0be73fad2bebb1937d2bc799de5bab0dc406b771cca98ec9
|
|
| MD5 |
1fb338c7c9737ea027d7c937afe4d5c2
|
|
| BLAKE2b-256 |
518a537686fae3012c406056c42f51c12674ba94ad7b430b29a311ba9540eff7
|
Provenance
The following attestation bundles were made for narxpy-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on ilmarcopardo/NARX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
narxpy-0.1.0-py3-none-any.whl -
Subject digest:
1608eefecdf6918c0be73fad2bebb1937d2bc799de5bab0dc406b771cca98ec9 - Sigstore transparency entry: 199212492
- Sigstore integration time:
-
Permalink:
ilmarcopardo/NARX@d050c3b1da5849d7967bad7b2c5f740ce2d93901 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ilmarcopardo
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@d050c3b1da5849d7967bad7b2c5f740ce2d93901 -
Trigger Event:
release
-
Statement type: