1c758ba9d6c14d9b9d3599e44c3508e2692d8d35,pyprob/distributions/empirical.py,Empirical,mode,#Empirical#,155
Before Change
self._mode = self.values[0]
else:
_, max_index = self.weights.max(-1)
self._mode = self.values[int(max_index)]
return self._mode
@property
def variance(self):
After Change
@property
def mode(self):
self._check_finalized()
// 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):
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: 1c758ba9d6c14d9b9d3599e44c3508e2692d8d35
Time: 2018-09-28
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/distributions/empirical.py
Class Name: Empirical
Method Name: __getitem__