Skip to content

Commit

Permalink
Add documentation to Discretize
Browse files Browse the repository at this point in the history
  • Loading branch information
aleju committed Sep 30, 2017
1 parent 94536be commit 5d3b709
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions imgaug/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,25 @@ def __str__(self):
return "Clip(%s, None, None)" % (opstr,)

class Discretize(StochasticParameter):
"""
Convert values sampled from a continuous distribution into discrete values.
This will round the values and then cast them to integers.
Values sampled from discrete distributions are not changed.
Parameters
----------
other_param : StochasticParameter
The other parameter, which's values are to be
discretized.
Examples
--------
>>> param = Discretize(Normal(0, 1.0))
Generates a discrete standard normal distribution.
"""
def __init__(self, other_param):
super(Discretize, self).__init__()
assert isinstance(other_param, StochasticParameter)
Expand Down

0 comments on commit 5d3b709

Please sign in to comment.