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.3

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.3
File Size Uploaded Provenance Actions
sw_mlp-1.0.3.tar.gz 11.3 kB Without provenance Details for sw_mlp-1.0.3.tar.gz

Built distribution (wheel)

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

Total release size: 27.6 kB

Release files / sw_mlp-1.0.3.tar.gz

Download URL sw_mlp-1.0.3.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1a51360f674588a6cf94b90de6b80d66edc8b62baea8d1d69fa5f6ced817dd61
BLAKE2b-256 checksum
How to use checksums
61edf734cc0162ecee6d2bb787fda560abb9d1859917dd833fc47a1a46c8f68a
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.3-py3-none-any.whl

Download URL sw_mlp-1.0.3-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
236472618770dc68c30bf9ab1cefd02ad24699f97da8b48ab80ad8ef7b8387c4
BLAKE2b-256 checksum
How to use checksums
3e1198e26e903038f65844a187f192e302688e1fa60a08013d37fcf3a5023016
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.3

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