This issue proposes to separate indexing logic from distribution logic in the Categorical distribution.
Currently Pyro's Categorical distribution bakes in logic to index against a list of values. This design choice leads to a number of difficulties:
Categorical is difficult to test and requires lots of custom testing logic.
- It is difficult to migrate to
torch.distributions whose categorical works with LongTensors.
Support for vs may be added back in later via a discrete Bijector.
This issue proposes to separate indexing logic from distribution logic in the
Categoricaldistribution.Currently Pyro's
Categoricaldistribution bakes in logic to index against a list of values. This design choice leads to a number of difficulties:Categoricalis difficult to test and requires lots of custom testing logic.torch.distributionswhose categorical works withLongTensors.Support for
vsmay be added back in later via a discreteBijector.