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

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

Built distribution (wheel)

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

Total release size: 27.6 kB

Release files / sw_mlp-1.0.2.tar.gz

Download URL sw_mlp-1.0.2.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1e0efa98bb477eefba0354cc6090eb14a624f66b0303fe8b4f2abb271799b05e
BLAKE2b-256 checksum
How to use checksums
18dbad578152ae15da11ea1dc6921919767b163530cd904f844cf35779814a2b
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.2-py3-none-any.whl

Download URL sw_mlp-1.0.2-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d94e731d0b5ce27b648a8543b5d6f3c4f0c7e6bc2e038f5c02124e1277264e08
BLAKE2b-256 checksum
How to use checksums
5af1b478fa2b4d4c10bca6e842f5e8daffaee740c81d289da184675baf27dec8
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.2

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