Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions autofit/interpolator/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ def __getitem__(self, item: Equality) -> ModelInstance:
value_map = self._value_map(item.path)
x = sorted(value_map)

if not self.instances:
raise IndexError(
"Cannot interpolate: no instances have been added to the interpolator."
)

instance = self.instances[0]
new_instance = copy.copy(instance)

Expand Down
7 changes: 6 additions & 1 deletion autofit/non_linear/grid/grid_search/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,12 @@ def log_evidences(self, relative_to_value: float = 0.0) -> GridList:
The value to subtract from every log likelihood, for example if Bayesian model comparison is performed
on the grid search and the subtracted value is the maximum log likelihood of a previous search.
"""
return [sample.log_evidence - relative_to_value for sample in self.samples]
return [
sample.log_evidence - relative_to_value
if sample.log_evidence is not None
else None
for sample in self.samples
]

def figure_of_merits(
self, use_log_evidences: bool, relative_to_value: float = 0.0
Expand Down
Loading