Code Monkey home page Code Monkey logo

mlframework's Introduction

mlframework

Building a rudimentary ml framework from scratch in rust.

Note

This project is a work in progess. It is also intended as a learning project to improve my understanding of ML framework implementation details and Rust.

Features

Basic operations with backprop

let x = Tensor::new([3., 4., 5.]);
let y = Tensor::new([1., -2., 1.]);
let z = Tensor::new([-3., 1., 3.]);
let s = ((x + y.clone() + y) * z.relu()).reduce_sum();

// Performs reverse mode autodiff and sets private grad field on tensors throughout the graph of `s`.
s.backward();

Compile-time shape checking

let x = Tensor::new([[0.0; 5]; 10]); // shape: [10, 5]

// Simply specify a Tensory w/ dtype and shape and call reshape
// If the shape is valid for the starting shape the code will compile
let x2: Tensor<f32, D3<2, 5, 5>> = x.reshape(); // shape: [2, 5, 5]

// This will *not* compile, becase the shape [51] is invalid for a tensor of shape [2, 5, 5]
let x3: Tensor<f32, D1<51>> = x2.reshape(); // ERROR!!

Status

  • Initial tensor structure
  • Basic elementwise operations
  • Basic backprop implementation
    • Fix graph traversal complexity
  • Tensor Shapes
  • Matmul
  • Tensor Indexing
  • Potentially improve Op implementation
    • Make it simpler to create/register new ops & backward functions
    • Generate similar ops using macros
  • Define a module structure
  • Implement an optimizer
  • Setup test structure
  • Organize repo code
  • Add CI w/ Github Actions

mlframework's People

Contributors

fynnsu avatar

Watchers

 avatar

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.