JamesYang007 / autoppl

C++ template library for probabilistic programming
https://jamesyang007.github.io/autoppl/
MIT License
45 stars 5 forks source link

add discrete wrapper #11

Open jenchen1398 opened 4 years ago

jacobaustin123 commented 4 years ago

The lower-case discrete function needs to be the only way of building Discrete objects. So all Discrete tests need to be changed to use this method. I think you will need to apply the transformation to every element in the vector for it to work. James will have some ideas. The goal is for weights_.[5].get_values() to always work, because the value type is always a Variable (or a Constant, e.g.).

JamesYang007 commented 4 years ago

We pushed the current impl of discrete with the intention that we weren't really gonna use it with expressions, but just values. Expressions can have different types and using variadic templates with tuple is like the only way to do this. This gets difficult because you must know the index at compile-time.

JamesYang007 commented 4 years ago

@all-contributors please add @jenchen1398 for code and design

allcontributors[bot] commented 4 years ago

@JamesYang007

I've put up a pull request to add @jenchen1398! :tada: