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
3 changes: 1 addition & 2 deletions scripts/cluster/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@

# from autoconf import setup_notebook; setup_notebook()

import jax.numpy as jnp
import numpy as np
from pathlib import Path
import autofit as af
Expand Down Expand Up @@ -248,7 +247,7 @@
)

solver = al.PointSolver.for_grid(
grid=grid, pixel_scale_precision=0.001, magnification_threshold=0.1, xp=jnp
grid=grid, pixel_scale_precision=0.001, magnification_threshold=0.1
)

"""
Expand Down
3 changes: 1 addition & 2 deletions scripts/guides/modeling/advanced/graphical.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
# from autoconf import setup_notebook; setup_notebook()

import numpy as np
import jax.numpy as jnp
from pathlib import Path
import autolens as al
import autofit as af
Expand Down Expand Up @@ -109,7 +108,7 @@
)

solver = al.PointSolver.for_grid(
grid=grid, pixel_scale_precision=0.001, magnification_threshold=0.1, xp=jnp
grid=grid, pixel_scale_precision=0.001, magnification_threshold=0.1
)

"""
Expand Down
3 changes: 1 addition & 2 deletions scripts/point_source/features/fluxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

# from autoconf import setup_notebook; setup_notebook()

import jax.numpy as jnp
from pathlib import Path
import autofit as af
import autolens as al
Expand Down Expand Up @@ -117,7 +116,7 @@
)

solver = al.PointSolver.for_grid(
grid=grid, pixel_scale_precision=0.001, magnification_threshold=0.1, xp=jnp
grid=grid, pixel_scale_precision=0.001, magnification_threshold=0.1
)

"""
Expand Down
2 changes: 0 additions & 2 deletions scripts/point_source/features/time_delays.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@

# from autoconf import setup_notebook; setup_notebook()

import jax.numpy as jnp
from pathlib import Path
import autofit as af
import autolens as al
Expand Down Expand Up @@ -121,7 +120,6 @@
grid=grid,
pixel_scale_precision=0.001,
magnification_threshold=0.1,
xp=jnp,
)

"""
Expand Down
12 changes: 1 addition & 11 deletions scripts/point_source/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@

# from autoconf import setup_notebook; setup_notebook()

import jax.numpy as jnp
from pathlib import Path
import autofit as af
import autolens as al
Expand Down Expand Up @@ -327,18 +326,9 @@

If you don’t have a GPU locally, consider Google Colab which provides free GPUs, so your modeling runs are much faster.
"""
# Hacky way to use JAX PointSolver, fix soon

solver_jax = al.PointSolver.for_grid(
grid=grid,
pixel_scale_precision=0.001,
magnification_threshold=0.1,
xp=jnp,
)

analysis = al.AnalysisPoint(
dataset=dataset,
solver=solver_jax,
solver=solver,
fit_positions_cls=al.FitPositionsImagePairRepeat, # Image-plane chi-squared with repeat image pairs.
use_jax=True, # JAX will use GPUs for acceleration if available, else JAX will use multithreaded CPUs.
)
Expand Down
14 changes: 2 additions & 12 deletions scripts/point_source/start_here.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@

# from autoconf import setup_notebook; setup_notebook()

import jax.numpy as jnp
import numpy as np
from pathlib import Path

Expand Down Expand Up @@ -190,7 +189,7 @@
)

solver = al.PointSolver.for_grid(
grid=grid, pixel_scale_precision=0.001, magnification_threshold=0.1, xp=jnp
grid=grid, pixel_scale_precision=0.001, magnification_threshold=0.1
)

"""
Expand Down Expand Up @@ -265,18 +264,9 @@
iterations_per_quick_update=250000, # Every N iterations the max likelihood model is visualized and written to output folder.
)

# Hacky way to use JAX PointSolver, fix soon

solver_jax = al.PointSolver.for_grid(
grid=grid,
pixel_scale_precision=0.001,
magnification_threshold=0.1,
xp=jnp,
)

analysis = al.AnalysisPoint(
dataset=dataset,
solver=solver_jax,
solver=solver,
use_jax=True, # JAX will use GPUs for acceleration if available, else JAX will use multithreaded CPUs.
)

Expand Down
Loading