PSANN
PSANN is a PyTorch library for regression with trainable sinusoidal activations, composed preprocessing, and episodic optimization. The separate psannlm distribution provides language modeling.
Version 2.0.1 is on the authoritative 2.x API track for both packages. New code should use the typed configuration interfaces shown here. Older constructors and flat configuration inputs are migration-only compatibility routes and are not part of the canonical public surface.
Install from this checkout
Use Python 3.9 or newer. Install a PyTorch build appropriate for your CPU or CUDA runtime before installing PSANN.
python -m pip install -e ".[sklearn]"
# Add language modeling when needed:
python -m pip install ./psannlm
psann depends on NumPy, PyTorch, and PyYAML. Scikit-learn is optional for cloning and model selection. Installing core alone does not install or expose psannlm. See the installation and LM guide for tokenizer and training dependencies.
Regression
import torch # Initialize PyTorch before optional scientific packages on Windows.
import numpy as np
from psann import PSANNRegressor
from psann.architectures import ArchitectureConfig
X = np.linspace(-1, 1, 64, dtype=np.float32)[:, None]
y = np.sin(3 * X).astype(np.float32)
model = PSANNRegressor(
architecture=ArchitectureConfig.dense(),
hidden_layers=1, hidden_units=16, epochs=8,
batch_size=16, lr=0.01, random_state=7, device="cpu",
)
model.fit(X, y)
predictions = model.predict(X)
model.save("regression.pt")
restored = PSANNRegressor.load("regression.pt", map_location="cpu")
np.testing.assert_allclose(restored.predict(X), predictions, rtol=0, atol=0)
Use nested architecture policies to select residual, convolutional, wave, sequence, or geometric-sparse behavior. Use PreprocessorConfig for LSM composition and EpisodicTrainer(estimator=..., strategy=HISSOConfig(...)) for episodic training. Language modeling uses PSANNLM, PSANNLMDataPrep, LMConfig, and LMArchitectureConfig, with python -m psannlm as its CLI.
Find a workflow
- Documentation index: task guides and reference.
- Executable quickstarts: regression, preprocessing, episodic optimization, and LM training; each saves and reloads twice.
- Architecture contract: supported combinations and validation.
- API reference: construction, fit, inference, and persistence.
- Migration and deprecation policy: compatibility routes for older applications and checkpoints.
- Changelog, contributing, and license.
Research examples illustrate experiments; they do not establish general accuracy or performance advantages. Historical result reports are labeled and are not current executable configurations.
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 psann-2.0.1.tar.gz.
File metadata
- Download URL: psann-2.0.1.tar.gz
- Upload date:
- Size: 174.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4573d7844f8ae51f91c28576ca29d66a9f73e519d94e84e1b8c53b6120d3d8e0
|
|
| MD5 |
5f9c3be5851b8ff0d5f123050b02d41b
|
|
| BLAKE2b-256 |
06d3abd01d38fb258b68cec88df803d34b4b0a1c3074802ad3f2cc13c6cbb214
|
File details
Details for the file psann-2.0.1-py3-none-any.whl.
File metadata
- Download URL: psann-2.0.1-py3-none-any.whl
- Upload date:
- Size: 222.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6125acd4abd8e92f1c75c61a9069e8f6a4dae1716d1790d2beecd98956a583e
|
|
| MD5 |
632d0e522f25dd4fbc53384a0eaf4491
|
|
| BLAKE2b-256 |
d78a4ecf309d6535b50f92050742c6cbad59e74db8ac2b51339ba7426af59a8b
|