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=142, 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.1

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

Built distribution (wheel)

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

Total release size: 27.6 kB

Release files / sw_mlp-1.0.1.tar.gz

Download URL sw_mlp-1.0.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d5ff1e472febecb4007498c98935c82f54200a9adc468c3b1b15c5d9f8a1188c
BLAKE2b-256 checksum
How to use checksums
54a1b3b52ecf868ef990a9573d92507eeb829d8e9b85b53020515e1248dbe737
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.1-py3-none-any.whl

Download URL sw_mlp-1.0.1-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3891d9c8865cb22cfad6fc2211f60fc2c5c83a9b029dfbc8daf8c9ad20bb160
BLAKE2b-256 checksum
How to use checksums
e0c642d8c668e8165f25361e47341e4fcdcd2267d9f901cd55cc25f90a4a118b
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.1

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