pyperch
PyPerch provides randomized hill climbing (RHC), simulated annealing (SA), and
genetic algorithm (GA) optimizers for ordinary torch.nn.Module workflows. Pass
native PyTorch parameter iterables, define the loss in a closure, and keep model
architecture, data loading, forward passes, metrics, and training loops in PyTorch.
Plotting utilities included in the normal installation prepare recorded results and render them on caller-owned Matplotlib Axes. A thin optional Optuna layer supports hyperparameter studies without hiding native trials or studies. Start with the General Usage Guide for optimizer semantics and complete examples.
Installation
PyPerch supports Python 3.10 through 3.13.
Install from PyPI:
pip install pyperch
pip install "pyperch[optuna]"
The normal installation includes NumPy for curve preparation and Matplotlib for rendering. The Optuna extra enables hyperparameter search. To run the repository's notebooks from a source checkout, follow the examples guide.
Development Setup
See CONTRIBUTING.md for source-checkout setup and validation.
Examples
PyPerch's RHC, SA, and GA optimizers operate directly on the parameters of standard
PyTorch models. Bring your own torch.nn.Module, loss function, data tensors,
evaluation code, and training loop. If a model works in PyTorch, it should generally
work with PyPerch optimizers.
- Native PyTorch training: Use RHC in a PyTorch training loop, including frozen layers and separate Adam/RHC updates.
- Optimizer convergence and cost: Compare RHC, SA, GA, and Adam across repeated runs.
- Training, learning, and validation curves: Explore optimization progress, training set size, model capacity, and generalization.
- Optuna tuning: Tune SA and GA settings with repeated Optuna trials and evaluate the selected refits.
See the examples guide for notebook-running instructions and reproducibility information.
Documentation
- General Usage Guide: RHC, SA, and GA in ordinary PyTorch training loops
- Examples guide: optimizer, freezing, composition, and comparison workflows
- Plotting API and terminology: prepare and render recorded curves
- Search Usage Guide: optional Optuna studies
Contributing
Pull requests are welcome. See CONTRIBUTING.md for the project philosophy, development checks, and review expectations.
Metadata
Release files for pyperch 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyperch-0.4.0.tar.gz | 15.7 kB | Without provenance | Details for pyperch-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyperch-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for pyperch-0.4.0-py3-none-any.whl |
Total release size: 35.9 kB
Release files / pyperch-0.4.0.tar.gz
| Download URL | pyperch-0.4.0.tar.gz |
|---|---|
| Size | 15.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1ee7a29dbef20c61b015d7dd03c3a9145d1aa4fc4a42caa37d081dfc39aaef2
|
|
BLAKE2b-256 checksum How to use checksums |
7d35f437e1aebbd1b4d9a7fdc7f9f101cb53c78df04f97b0afdced4ec6449ba4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.13.9 Darwin/25.6.0
|
Release files / pyperch-0.4.0-py3-none-any.whl
| Download URL | pyperch-0.4.0-py3-none-any.whl |
|---|---|
| Size | 20.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9e93e668499a0a428db39173c28fbd217b7217c873bf0b0348047cde2096a70d
|
|
BLAKE2b-256 checksum How to use checksums |
3acaab34c84795ac56a6061ff45ed5c0e74bf1e3c03af55a289c2610c798b5a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.13.9 Darwin/25.6.0
|
Security for pyperch 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.