Giter VIP home page Giter VIP logo

tinyflow's Introduction

Tinyflow is a simple deep learning framework for learning purposes. It supports automatic differentiation and GPU acceleration. TinyFlow currently provides all the operators needed to build a multilayer perceptron models (MLP).

If you want to learn more about the principles behind Tinyflow, the following two blog posts may provide a lot of intuition.

Install

Tinyflow currently only supports running in 64-bit linux environment. Requirement:

  • gcc >= 4.8;
  • cmake >= 3.13 (if you choose to use cmake);
  • CUDA 9.0
  • python 3

Download the source code.

git clone https://github.com/LB-Yu/tinyflow.git

Generally speaking, CUDA will be installed in /use/local/cuda. If your installation path is different, please modify the CUDA_DIR variable on the first line of the Makefile to your installation path, or modify the CUDA_DIR variable on the fourth line of CMakeLists.txt to your installation path.

For compiling with Makefile.

cd tinyflow
make

For compiling with CMake.

cd tinyflow
mkdir build
cmake ..
make
make install

Run the MNIST Example

After compiling the GPU library, we can train an MLP on the MNIST dataset.

export PYTHONPATH="/path/to/tinyflow/python:${PYTHONPATH}"

# see cmd options with 
# python tests/mnist_dlsys.py -h

# run logistic regression on numpy
python tests/mnist_dlsys.py -l -m logreg -c numpy
# run logistic regression on gpu
python tests/mnist_dlsys.py -l -m logreg -c gpu
# run MLP on numpy
python tests/mnist_dlsys.py -l -m mlp -c numpy
# run MLP on gpu
python tests/mnist_dlsys.py -l -m mlp -c gpu

Overview of Module

  • python/dlsys/autodiff.py: Implements computation graph, autodiff, GPU/Numpy Executor.

  • python/dlsys/gpu_op.py: Exposes Python function to call GPU kernels via ctypes.

  • python/dlsys/ndarray.py: Exposes Python GPU array API.

  • src/dlarray.h: header for GPU array.

  • src/c_runtime_api.h: C API header for GPU array and GPU kernels.

  • src/gpu_op.cu: cuda implementation of kernels

tinyflow's People

Contributors

lb-yu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

tinyflow's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.