Skip to main content

sw-mlp

A NumPy multilayer perceptron for regression and classification, with live training visualization.

Requires Python 3.12.

pip install sw-mlp

Example: ReLU regression

Generate noisy 1D data and train a model, using the same setup as the repository's regre-relu example. No external dataset or configuration file is needed.

import mlp

x, y = mlp.generate_data_rand(seed=145, number=500, noise_scale=0.02)
model = mlp.MultiLayerPerceptron(
    shape=[1, 64, 32, 1],
    activation_functions=[mlp.relu, mlp.relu, None],
    init_methods=["he", "he", "he"],
)
model.train(
    x, y,
    max_iter=4000,
    learning_rate=0.02,
    batch_size=100,
    threshold=0,
    animation="plot",
)
model.save_plots()

x_test, y_test = mlp.generate_data_rand(seed=123, number=50, noise_scale=0.02)
model.test(x_test, y_test)

Run as a Python script with a graphical Matplotlib backend to see live predictions. Outputs: params.json, predictions.json, and visualize/loss.png in the current directory.

Source code and documentation

Metadata

Release files for sw-mlp 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sw-mlp 1.0.4
File Size Uploaded Provenance Actions
sw_mlp-1.0.4.tar.gz 11.4 kB Without provenance Details for sw_mlp-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sw-mlp 1.0.4
File Interpreter ABI Platform Actions
sw_mlp-1.0.4-py3-none-any.whl Python 3 none any Details for sw_mlp-1.0.4-py3-none-any.whl

Total release size: 27.9 kB

Release files / sw_mlp-1.0.4.tar.gz

Download URL sw_mlp-1.0.4.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3e3ae36573e035a0e6d34a69b5ea23964ed9982c0a16bf073cec5a3815f98539
BLAKE2b-256 checksum
How to use checksums
5d8a7dba8ceda80f76261a49cb28b4edeb302872ac3b0c4edb5ac27a85014d10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / sw_mlp-1.0.4-py3-none-any.whl

Download URL sw_mlp-1.0.4-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7755beac35a2763220d3b15593d974d76c000f66c950dde47c5dd18a29d7d349
BLAKE2b-256 checksum
How to use checksums
b012f70a6c996e7c8000f6025df772444de17bcde22f9be3a7c18543631d9a63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for sw-mlp 1.0.4

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page