Skip to content

Commit 8df2445

Browse files
Jammy2211Jammy2211
authored andcommitted
update grids
1 parent 59e00b9 commit 8df2445

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

autolens/imaging/model/analysis.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,13 @@ def log_likelihood_function(self, instance: af.ModelInstance) -> float:
6262
xp=self._xp
6363
)
6464

65-
return self.fit_from(instance=instance).figure_of_merit - log_likelihood_penalty
65+
if self.use_jax:
66+
return self.fit_from(instance=instance).figure_of_merit - log_likelihood_penalty
67+
68+
try:
69+
return self.fit_from(instance=instance).log_likelihood - log_likelihood_penalty
70+
except Exception as e:
71+
raise af.exc.FitException
6672

6773
def fit_from(
6874
self,

autolens/imaging/simulator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def via_deflections_and_galaxies_from(self, deflections : aa.VectorYX2D, galaxie
122122
values=grid - deflections,
123123
mask=grid.mask,
124124
over_sample_size=1,
125-
over_sampled=grid - deflections
125+
over_sampled=grid - deflections,
126+
over_sampler=grid.over_sampler
126127
)
127128

128129
image = sum(map(lambda g: g.image_2d_from(grid=deflected_grid), galaxies))

autolens/interferometer/simulator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def via_deflections_and_galaxies_from(
8989
mask=grid.mask,
9090
over_sample_size=1,
9191
over_sampled=grid - deflections,
92+
over_sampler=grid.over_sampler
9293
)
9394

9495
image = sum(map(lambda g: g.image_2d_from(grid=deflected_grid), galaxies))

autolens/lens/tracer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ def traced_grid_2d_list_from(
282282
mask=grid.mask,
283283
over_sampled=grid_2d_over_sampled_list[i],
284284
over_sample_size=grid.over_sample_size,
285+
over_sampler=grid.over_sampler
285286
)
286287

287288
grid_2d_new_list.append(grid_2d_new)

0 commit comments

Comments
 (0)