Microtensor is a small autograd-style engine inspired by the micrograd library. It provides a minimal tensor API, basic layers, loss functions, and a tiny MLP for experiments. It also supports GPU training via CuPy when a CUDA device is available.
- Autograd-style
Tensorwith backward propagation - Core activations: ReLU, Leaky ReLU, Tanh, Sigmoid
- Loss functions: MSE, Binary Cross Entropy, Softmax Loss
- Simple MLP with dropout
- GPU training support (CuPy) with automatic fallback to NumPy
from api.tensor import Tensor
from api.loss import MSE_loss
# simple forward
x = Tensor([[1.0, -2.0, 3.0]])
y = Tensor([[0.0, 1.0, 0.0]])
out = x.tanh()
loss = MSE_loss(out, y)
# backward
loss.backward()
print("loss:", loss.data)
print("grad:", x.grad)If cupy is installed and a CUDA-capable GPU is available, the engine will use GPU arrays automatically. Otherwise, it falls back to NumPy.
From the project root:
python -m traning.titaniclicense - MIT