facebookincubator / flowtorch

This library would form a permanent home for reusable components for deep probabilistic programming. The library would form and harness a community of users and contributors by focusing initially on complete infra and documentation for how to use and create components.
https://flowtorch.ai
MIT License
301 stars 21 forks source link

Switch argument order for Bijector's, etc. #62

Closed stefanwebb closed 3 years ago

stefanwebb commented 3 years ago

Motivation

One awkwardness of the previous API is that the user has to ensure they instantiate a Bijector using a keyword argument for params. I.e. there will be an error if the user writes:

bijs.AffineAutoregressive(params.DenseAutoregressive())

rather than

bijs.AffineAutoregressive(params=params.DenseAutoregressive()).

Changes proposed

I propose to fix this and reduce potential user errors by making params the first and non-keyword argument of Bijector.

There are a few analogous changes around the code to support this.