Skip to content

Commit

Permalink
Fix Empirical *parameter* event ndims.
Browse files Browse the repository at this point in the history
A *scalar* Empirical has self.event_ndims=0 and is parameterized by a *vector* samples of scalars.
A *matrix* Empirical has self.event_ndims=1 and is parameterized by a *matrix* samples of vectors.
Therefore we should be advertising _params_event_ndims=dict(self.event_ndims+1).

PiperOrigin-RevId: 237457364
  • Loading branch information
brianwa84 authored and tensorflower-gardener committed Mar 8, 2019
1 parent f21635c commit a3d2fec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tensorflow_probability/python/distributions/empirical.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _param_shapes(sample_shape):
return {'samples': tf.convert_to_tensor(value=sample_shape, dtype=tf.int32)}

def _params_event_ndims(self):
return dict(samples=self._event_ndims)
return dict(samples=self._event_ndims + 1)

@property
def samples(self):
Expand Down

0 comments on commit a3d2fec

Please sign in to comment.