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

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


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.6.1.tar.gz (18.9 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.6.1-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

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

Hashes for helixnet-0.6.1.tar.gz
Algorithm Hash digest
SHA256 e2575aab6ac0202c6272e70ee54264bca254b4620c8baafef72966b5e7ecd0df
MD5 f3b1f435f07559b2486f473714ae7464
BLAKE2b-256 6281ee1417077695dde002832b1fe3ae8c73252d81e7b5fa3d11a946dfb3f6d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for helixnet-0.6.1.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.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

Hashes for helixnet-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c3bafbf43ac81c193090707182e60ce64a20ee02d42e6af79f94b10e3d1c797
MD5 e8b6feaa1031d22c4e2fc126a33ec149
BLAKE2b-256 ecdec48fcf7f911549f8d033b72cc48e1e663e75f8762d055ca315b9a08c9405

See more details on using hashes here.

Provenance

The following attestation bundles were made for helixnet-0.6.1-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