'Update the probability for the given sample. This may cause the object
to stop being the valid probability distribution - the user must
ensure that they update the sample probabilities such that all samples
have probabilities between 0 and 1 and that all probabilities sum to
one.
:param sample: the sample for which to update the probability
:type sample: any
:param prob: the new probability
:type prob: float
:param log: is the probability already logged
:type log: bool'

def update(self, sample, prob, log=True):

    i = self._sample_dict.get(sample)
    assert (i is not None)
    if self._logs:
        self._data[i] = (prob if log else math.log(prob, 2))
    else:
        self._data[i] = ((2 ** prob) if log else prob)
