1c758ba9d6c14d9b9d3599e44c3508e2692d8d35,pyprob/distributions/empirical.py,Empirical,mode,#Empirical#,155

Before Change


            print(colored("Warning: weights are uniform and there is no unique mode.", "red", attrs=["bold"]))
        if self._mode is None:
            if self.sorted_by_weights:
                self._mode = self.values[0]
            else:
                _, max_index = self.weights.max(-1)
                self._mode = self.values[int(max_index)]
        return self._mode

    @property

After Change


        // if self._uniform_weights:
        //     print(colored("Warning: weights are uniform and there is no unique mode.", "red", attrs=["bold"]))
        if self._mode is None:
            _, max_index = util.to_tensor(self._log_weights).max(-1)
            self._mode = self._get_value(int(max_index))
        return self._mode

    @property
    def effective_sample_size(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pyprob/pyprob
Commit Name: 1c758ba9d6c14d9b9d3599e44c3508e2692d8d35
Time: 2018-09-28
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/distributions/empirical.py
Class Name: Empirical
Method Name: mode


Project Name: pyprob/pyprob
Commit Name: 1c758ba9d6c14d9b9d3599e44c3508e2692d8d35
Time: 2018-09-28
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/distributions/empirical.py
Class Name: Empirical
Method Name: __iter__


Project Name: pyprob/pyprob
Commit Name: 1c758ba9d6c14d9b9d3599e44c3508e2692d8d35
Time: 2018-09-28
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/distributions/empirical.py
Class Name: Empirical
Method Name: mode


Project Name: pyprob/pyprob
Commit Name: ba5939a016a6ee4e0d29d2f9f711e853d866eb7a
Time: 2019-02-23
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/distributions/empirical.py
Class Name: Empirical
Method Name: copy