Skip to content

A C++/Python library for neural networks, multidimensional arrays, and much more!

License

Notifications You must be signed in to change notification settings

d-kicinski/tensor

Repository files navigation

tensor Documentation Status

package build/tests coverage
C++ Build C++ codecov
Python Build Python codecov

This library provides a two main features:

  • A class for interacting with multidimensional arrays (For backend library uses BLAS/LAPACK libraries with fallback to own naive implementations).
  • Deep neural networks.

The design goal is to create a numpy/pytorch alike interface for interacting with multidimensional arrays packaged in a simple, relatively lightweight, library with limited external dependencies that could be used on platforms like android phones and microcontrollers.

Features:

  • tensor:
    • classes and utilities for interacting with nd-arrays
    • sane interface to gemm routines
  • tensor/nn:
    • layers: FeedForward, Conv2D(naive/im2col), RNN, LSTM, Pooling, Dropout, BatchNormalization2D
    • optimizers: SGD(with momentum), Adagrad, RMSProp, Adam
    • saving/restoring models using protobuf
  • Python
    • wrapper for major of the tensor and tensor/nn functionalities
    • experimental autograd module (PyTorch alike)

Coming soon:

  • tensor:
    • improved naive GEMM implementation using AVX2 intrinsics
  • tensor/nn:
    • layers: SelfAttention, LayerNorm

Examples

How to use in your C++ project

If you're using cmake see tensor-example for example usage.

How to use Python wrapper

Install the latest release pip install https://github.com/d-kicinski/tensor/releases/download/v0.2.0/tensor-0.2.0-cp38-cp38-linux_x86_64.whl. Alternatively, clone this repo and build it by yourself.

Documentation

For basic usages see this doc