pyro-ppl / funsor

Functional tensors for probabilistic programming
https://funsor.pyro.ai
Apache License 2.0
236 stars 20 forks source link

Add named_tensor_notation_i tutorial to index file #513

Closed ordabayevy closed 3 years ago

ordabayevy commented 3 years ago

Run make docs, looks fine.

Actually, some latex code is not displayed. Investigating ...

ordabayevy commented 3 years ago

Some latex code were missing $$ .. $$ and were not displayed in html after running make docs. Now it should be displayed correctly.

fehiepsi commented 3 years ago

https://funsor.pyro.ai/en/latest/tutorials/named_tensor_notation_i.html here it goes

fritzo commented 3 years ago

I guess for the colab notebook to work, we would need a !pip install funsor['torch'] at the top? @fehiepsi how do you deal with installation in NumPyro?

ordabayevy commented 3 years ago

Also for the notebook to work and be displayed correctly master branch has to be installed. For example this doesn't work in stable version:

TypeError                                 Traceback (most recent call last)
<ipython-input-54-44192045c904> in <module>()
      1 layer = Tensor(tensor([0, 1, 2, 3, 4, 5, 6, 7, 8]), dtype=9)["layer"]
      2 
----> 3 A(height=layer // Number(3, 4), width=layer % Number(3, 4))

TypeError: unsupported operand type(s) for //: 'Tensor' and 'Number
fehiepsi commented 3 years ago

I guess we can add

!pip install funsor[torch]@git+https://github.com/pyro-ppl/funsor

to the top of the notebook. Currently, numpyro also suffers from the same issue (even worse, numpyro changes colab default devices gpu/tpu to cpu).