A powerful simple Neural Network building blocks based on MyGrad
Project description
A small, extensible, and lightweight framework for building powerful neural networks in Python, built on mygrad.
HelixNet is designed to be a transparent and easy-to-understand tool for learning and experimentation. It is powerful enough to run complex models like CNNs and LSTMs, but simple enough to run efficiently on modest hardware.
Key Features
- Lightweight & Simple: No complex compilation or heavy dependencies. Just plug and play.
- Extensible by Design: A clean, object-oriented structure (
Layer,Optimiser) makes it easy to create your own custom layers and optimizers. - Modern Architecture: Includes common layers like
Dense,Conv2D,MaxPooling2D,LSTM, andEmbedding. - Powerful Optimizers: Comes with robust implementations of
SGD(with momentum),RMSPropandAdam. - Full Documentation: Comprehensive documentation available here.
Installation
Currently, HelixNet can be installed directly from the source repository. Ensure you have setuptools and wheel installed.
# For the latest stable version
pip install .
# For development (editable) mode
pip install -e .
Quickstart: Training a Model
Here's a quick example of how to build and train a model on the classic "spiral" dataset.
import numpy as np
import mygrad as mg
import helixnet.layers as layers
import helixnet.optimisers as optimisers
import helixnet.activations as activations
import helixnet.models as models
from nnfs.datasets import spiral_data
# Create dataset
X, y = spiral_data(samples=100, classes=3)
X = mg.tensor(X)
y = mg.tensor(y, dtype=int)
# Build model
model = models.Sequental([
layers.Dense(2, 64, activation=activations.ReLU),
layers.Dense(64, 3, activation=(lambda x: x)) # Logits
])
optim = optimisers.Adam(learning_rate=0.05, decay=5e-7)
# Train the model
for epoch in range(10001):
logits = model.forward(X)
loss = mg.nnet.losses.softmax_crossentropy(logits, y)
loss.backward()
optim.optimise(model)
model.null_grads()
if epoch % 100 == 0:
accuracy = np.mean(np.argmax(logits.data, axis=1) == y.data)
print(f'Epoch: {epoch}, Loss: {loss.data:.4f}, Accuracy: {accuracy:.4f}')
Documentation
For a full guide to all layers, optimizers, and functionalities, please see the Full HelixNet Documentation.
Contributing
Contributions are welcome! If you find a bug or have a feature request, please open an issue. If you'd like to contribute code, please see the notes on our own contributions to mygrad (#445) for an example of our development philosophy.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file helixnet-0.6.1.tar.gz.
File metadata
- Download URL: helixnet-0.6.1.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2575aab6ac0202c6272e70ee54264bca254b4620c8baafef72966b5e7ecd0df
|
|
| MD5 |
f3b1f435f07559b2486f473714ae7464
|
|
| BLAKE2b-256 |
6281ee1417077695dde002832b1fe3ae8c73252d81e7b5fa3d11a946dfb3f6d4
|
Provenance
The following attestation bundles were made for helixnet-0.6.1.tar.gz:
Publisher:
python-publish.yml on TheIridiumMan/HelixNet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
helixnet-0.6.1.tar.gz -
Subject digest:
e2575aab6ac0202c6272e70ee54264bca254b4620c8baafef72966b5e7ecd0df - Sigstore transparency entry: 281480435
- Sigstore integration time:
-
Permalink:
TheIridiumMan/HelixNet@849b164be1f025cbed0f6992cd4972a5ab7b2dd6 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/TheIridiumMan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@849b164be1f025cbed0f6992cd4972a5ab7b2dd6 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file helixnet-0.6.1-py3-none-any.whl.
File metadata
- Download URL: helixnet-0.6.1-py3-none-any.whl
- Upload date:
- Size: 22.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c3bafbf43ac81c193090707182e60ce64a20ee02d42e6af79f94b10e3d1c797
|
|
| MD5 |
e8b6feaa1031d22c4e2fc126a33ec149
|
|
| BLAKE2b-256 |
ecdec48fcf7f911549f8d033b72cc48e1e663e75f8762d055ca315b9a08c9405
|
Provenance
The following attestation bundles were made for helixnet-0.6.1-py3-none-any.whl:
Publisher:
python-publish.yml on TheIridiumMan/HelixNet
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
helixnet-0.6.1-py3-none-any.whl -
Subject digest:
8c3bafbf43ac81c193090707182e60ce64a20ee02d42e6af79f94b10e3d1c797 - Sigstore transparency entry: 281480461
- Sigstore integration time:
-
Permalink:
TheIridiumMan/HelixNet@849b164be1f025cbed0f6992cd4972a5ab7b2dd6 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/TheIridiumMan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@849b164be1f025cbed0f6992cd4972a5ab7b2dd6 -
Trigger Event:
workflow_dispatch
-
Statement type: