homemade pytorch

Flint

A toy deep learning framework implemented in Numpy from scratch with a PyTorch-like API. I’m trying to make it as clean as possible.

Flint is not as powerful as torch, but it is still able to start a fire.

Installation

git clone https://github.com/Renovamen/flint.git
cd flint
python setup.py install

or

pip install git+https://github.com/Renovamen/flint.git --upgrade

Tutorials

Features

Core

Support autograding on the following operations:

  • Add

  • Substract

  • Negative

  • Muliply

  • Divide

  • Matmul

  • Power

  • Natural Logarithm

  • Exponential

  • Sum

  • Max

  • Softmax

  • Log Softmax

  • View

  • Transpose

  • Permute

  • Squeeze

  • Unsqueeze

  • Padding

Layers

  • Linear

  • Convolution (1D / 2D)

  • MaxPooling (1D / 2D)

  • Unfold

  • Flatten

  • Dropout

  • Sequential

  • Identity

Optimizers

  • SGD

  • Momentum

  • Adagrad

  • RMSprop

  • Adadelta

  • Adam

Loss Functions

  • Cross Entropy

  • Negative Log Likelihood

  • Mean Squared Error

  • Binary Cross Entropy

Activation Functions

  • ReLU

  • Sigmoid

  • Tanh

  • Leaky ReLU

  • GELU

Initializers

Others

  • Dataloaders

License

MIT

Acknowledgements

Flint is inspired by the following projects: