Giter VIP home page Giter VIP logo

tch-distr-rs's Introduction

tch-distr-rs

This is an attempt of mimicking the python torch.distributions module.

Rust has a very good wrapper around libtorch: https://github.com/LaurentMazare/tch-rs. However, the torch.distributions module only exists in python and therefor needs to be implemented in rust which is a lot of work. Also, the python module is very well tested.

To ease the work for porting the distributions tch-distr-rs's output is tested against the python implementations.

If you want to help out and implement a missing distribution feel free to add it, implement the Distribution trait and include some tests in tests/against_python.rs.

Currently, the Distribution trait is not stable and it will most likely change (Suggestions welcome!).

Notes on the tests

The tests require nightly, because of the python wrapper pyo3 and also the python torch library.

On arch linux the tests segfaulted for me when I used the aur/libtorch together with tch, which seems to have been a conflict between the python torch and libtorch.

Using community/python-pytorch instead worked for me.

Distributions

  • bernoulli
  • beta
  • binomial
  • categorical
  • cauchy
  • chi2
  • continuous_bernoulli
  • dirichlet
  • exponential
  • fishersnedecor
  • gamma
  • geometric
  • gumbel
  • half_cauchy
  • half_normal
  • independent
  • kl
  • laplace
  • log_normal
  • logistic_normal
  • lowrank_multivariate_normal
  • mixture_same_family
  • multinomial
  • multivariate_normal
  • negative_binomial
  • normal
  • one_hot_categorical
  • pareto
  • poisson
  • relaxed_bernoulli
  • relaxed_categorical
  • studentT
  • transformed_distribution
  • uniform
  • von_mises
  • weibull

tch-distr-rs's People

Contributors

spebern avatar dpuyosa 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.