A flexible deep learning library for machine learning and scientific computing with GPU acceleration.
Project description
Heroch: High-Performance Deep Learning and Scientific Computing Library
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.
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39bb42fad3197809d7ea24cd0c76d853cd9843ab7cc13cc86c87f8440a625a5d
|
|
| MD5 |
31e7a20d64d8b84e738c9c2d5a58b851
|
|
| BLAKE2b-256 |
6e317e24fa8ccaa82fb77c5049943f9ab796fb9e7d1a912cc41746fe78f45648
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc32f163465624011e31df1468657f711480b6bf7223b6a0c680981be4eb40b1
|
|
| MD5 |
3fa318b53a903001aed2ee6e4294d168
|
|
| BLAKE2b-256 |
1ad10a9571895ac8e7e0fd0076c6e2ff8a163173e755a6fa1bf605e4b441e3cf
|