Skip to main content

Heroch: High-Performance Deep Learning and Scientific Computing Library

PyPI version License: MIT

Heroch is a powerful, flexible, and intuitive Python library designed for machine learning, deep learning, and scientific computing. It provides a high-performance tensor computation platform with seamless GPU acceleration (via CUDA/CuPy) and a dynamic automatic differentiation (autograd) engine.

Why Heroch?

Heroch is built to feel like a native Python library, integrating perfectly with the SciPy ecosystem. Whether you are conducting academic research or building production-level neural networks, Heroch offers the flexibility to experiment and the speed to scale.

Key Features

  • ⚡ High-Performance Tensor Computations: Native NumPy interface with optional GPU acceleration for massive speedups.
  • 🧠 Dynamic Autograd Engine: Flexible computational graphs that allow you to change network structures on the fly.
  • 🛠️ Complete Deep Learning Platform: Built-in modules for linear layers, common activations (ReLU, Sigmoid), and loss functions (MSELoss).
  • 🚀 Optimized Training: Robust optimizers including Stochastic Gradient Descent (SGD) with momentum.
  • 🐍 Pythonic API: Intuitive design that is easy to debug and executes code as you write it.

Installation

Install Heroch easily via pip:

pip install heroch

Note: For GPU support, ensure you have an NVIDIA GPU and the appropriate CUDA drivers installed.

Quick Start Example

Build and train a simple neural network in minutes:

import heroch
import heroch.nn as nn
import heroch.optim as optim
from heroch import Tensor

# Define your flexible model structure
class MyNeuralNetwork(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = nn.Linear(2, 4)
        self.relu = nn.ReLU()
        self.fc2 = nn.Linear(4, 1)
        
    def forward(self, x):
        x = self.relu(self.fc1(x))
        return self.fc2(x)

# Initialize model, loss, and optimizer
model = MyNeuralNetwork()
criterion = nn.MSELoss()
optimizer = optim.SGD(model.parameters(), lr=0.01, momentum=0.9)

# Training data
inputs = Tensor([[1.0, 2.0], [3.0, 4.0]])
targets = Tensor([[5.0], [11.0]])

# Training loop
for epoch in range(100):
    optimizer.zero_grad()
    predictions = model(inputs)
    loss = criterion(predictions, targets)
    loss.backward()
    optimizer.step()
    
    if epoch % 10 == 0:
        print(f"Epoch {epoch}, Loss: {loss.data}")

Advanced Usage: GPU Acceleration

Heroch makes it easy to move your computations to the GPU:

# Move model parameters and data to GPU
x_gpu = Tensor([1.0, 2.0, 3.0]).to_gpu()

Contributing

We welcome contributions from the community! Check out our GitHub repository to get involved.


Developed with 🔥 by Death Legion Team.

Download files

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

Source Distribution

heroch-0.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

heroch-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file heroch-0.1.0.tar.gz.

File metadata

  • Download URL: heroch-0.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for heroch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 39bb42fad3197809d7ea24cd0c76d853cd9843ab7cc13cc86c87f8440a625a5d
MD5 31e7a20d64d8b84e738c9c2d5a58b851
BLAKE2b-256 6e317e24fa8ccaa82fb77c5049943f9ab796fb9e7d1a912cc41746fe78f45648

See more details on using hashes here.

File details

Details for the file heroch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: heroch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for heroch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc32f163465624011e31df1468657f711480b6bf7223b6a0c680981be4eb40b1
MD5 3fa318b53a903001aed2ee6e4294d168
BLAKE2b-256 1ad10a9571895ac8e7e0fd0076c6e2ff8a163173e755a6fa1bf605e4b441e3cf

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

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