ba5939a016a6ee4e0d29d2f9f711e853d866eb7a,pyprob/distributions/empirical.py,Empirical,_get_value,#Empirical#Any#,168
Before Change
def _get_value(self, index):
if self._on_disk:
if index < 0:
return self._get_value(self._length + index)
return self._shelf[str(index)]
else:
return self._values[index]
After Change
emp_index = self._concat_cum_sizes.searchsorted(index, "right")
if emp_index > 0:
index = index - self._concat_cum_sizes[emp_index - 1]
return self._concat_empiricals[emp_index]._get_value(index)
def _get_log_weight(self, index):
return self._categorical.logits[index]
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
Instances
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: _get_value
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: sample
Project Name: polyaxon/polyaxon
Commit Name: f95cd01d5f66d6ffb010582655a7ed79c6a6faac
Time: 2019-07-18
Author: mouradmourafiq@gmail.com
File Name: polyaxon/conf/option_service.py
Class Name: OptionService
Method Name: get
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__