Skip to main content

A powerful simple Neural Network building blocks based on MyGrad

Project description

License: MIT

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, and Embedding.
  • Powerful Optimizers: Comes with robust implementations of SGD (with momentum), RMSProp andAdam.
  • Full Documentation: Comprehensive documentation available here.

Installation

# For the latest stable version
pip install HelixNet

# 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

helixnet-0.7.0.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

helixnet-0.7.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file helixnet-0.7.0.tar.gz.

File metadata

  • Download URL: helixnet-0.7.0.tar.gz
  • Upload date:
  • Size: 19.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for helixnet-0.7.0.tar.gz
Algorithm Hash digest
SHA256 12e53001a414559f2e9f136038e2aea5b375e46ae05f2ce8bb8f442dbb4b3fe8
MD5 51c41148e03a3643cbd593b9cb7c4c87
BLAKE2b-256 0891060b7693fce4387a6b99e567aec340fdf5760c387801fc242a5ab4fa0ed3

See more details on using hashes here.

Provenance

The following attestation bundles were made for helixnet-0.7.0.tar.gz:

Publisher: python-publish.yml on TheIridiumMan/HelixNet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file helixnet-0.7.0-py3-none-any.whl.

File metadata

  • Download URL: helixnet-0.7.0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for helixnet-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7639cd201e2ffe64b7fd056fbfefd11f46c7994cc6be7be1dce42c9dd415e69f
MD5 d2c912c3c7c9a0e1c8fa7f0b5ec46e89
BLAKE2b-256 49852d832649e54941fa4a6f03cc3a33b732e2d464cdddfd0f58ccea40412686

See more details on using hashes here.

Provenance

The following attestation bundles were made for helixnet-0.7.0-py3-none-any.whl:

Publisher: python-publish.yml on TheIridiumMan/HelixNet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page