Korgorusz is a simple machine learning framework build on top of numpy.
- Modular design
- Slow
- No GPU support
- Types
- Depends only on numpy
import numpy as np
from korgorusz.optimizers import SGDOptimizer
from korgorusz.layers import Linear
from korgorusz.activations import ReLU, Sigmoid
from korgorusz.utils import minibatch, mse, Model
x = np.random.randn(5,4)
y = np.random.randn(5,2)
optim = SGDOptimizer(learning_rate=0.01)
model = Model([
Linear(4, 8),
ReLU(),
# ...
Linear(8, 2),
Sigmoid()])
for e in range(8):
pred = model.forward(x)
loss, d = mse(pred,y)
model.backward(d)
optim.update(model.layers_elements())
More examples in the notebooks.
python -m venv venv
source venv/bin/activate
pip install korgorusz/.
# or
pip install korgorusz/.[dev]
pytest korgorusz # test suite
mypy korgorusz # type checks
black korgorusz # formatting
pylint korgorusz/ -d R0903 --good-names=l2,x,y,i # linter
- ReLU
- Softmax
- Sigmoid
- SGD
- Momentum
- Adam
- MSE
- MAE
- Cross-Entropy
- Linear
- Dropout
- LayerNorm
- Embedding
Korgorusz is a slavic cat deamon.