Coder Social home page Coder Social logo

0b01 / tensorscript Goto Github PK

View Code? Open in Web Editor NEW
51.0 6.0 1.0 509 KB

shapechecking neural net DSL using Hindley-Milner type system(compiles to pytorch as proof of concept)

Home Page: https://tensorscript.org

Python 5.84% Rust 94.16%
pipes-operator pytorch neural-network hindley-milner dsl

tensorscript's Introduction

TensorScript

Dependently-typed tensor computation.

Features

  • Parametric polymorphism
  • Compile time type checking
  • Dependently typed tensors
  • Multiple targets(Tensorflow, PyTorch, more to come!)
  • Pipes operator

Pipes operator

Pipes operator is a syntax sugar for chained function calls inspired by F#, Elixir and R. For example,

x |> lin1 |> leaky_relu(p=0.2) |> sigmoid

compiles to

x = lin1(x)
x = leaky_relu(x, p=0.2)
x = sigmoid(x)

Development

Build Status

The language is not usable in production or development.

Todo

  1. implement module pattern matching
  2. type level computation (resolved tensor dimension)
  3. BUG: dimension mismatch for mnist example need to create fresh type variables for different static forward functions
  4. BUG: non-determinism
  5. BUG: impl Hash, Eq for Type
  6. set up examples and tests
  7. set up commandline
  8. more examples
  9. better errors in parser
  10. code gen: PyTorch
  11. add more examples
  12. lift dim and tsr to top level
  13. add dim level computation dim1 * dim1
  14. use Linear as L; aliasing
  15. add binary ops (+, -, *, /, %)
  16. add if else expression
  17. add let binding
  18. add more tests

tensorscript's People

Contributors

0b01 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

iq-scm

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.