noegroup / bgflow

Boltzmann Generators and Normalizing Flows in PyTorch
MIT License
138 stars 36 forks source link

What is SloppyUniform and why might it interfer with the python debugger? #76

Open HannesStark opened 1 year ago

HannesStark commented 1 year ago

Hi and thanks for the library!

What is the purpose of SloppyUniform instead of torch.distributions.uniform.Uniform and why might it be causing my debugger to no longer stop at breakpoints? https://github.com/noegroup/bgflow/blob/fbba56fac3eb88f6825d2bd4f745ee75ae9715e1/bgflow/distribution/distributions.py#L81

Thanks for any insights!

Olllom commented 1 year ago

Hi Hannes, unfortunately, this is the ugliest hack you have ever seen. This is a uniform distribution that tolerates samples sloshing slightly over the boundaries due to small numerical errors in the flow. The implementation is gruesome though.