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
2 changes: 1 addition & 1 deletion llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ AUTO-GENERATED by PyAutoHands — do not edit by hand; regenerate with generate.
- [Tutorial 4: Lens Modeling](scripts/chapter_3_pixelizations/tutorial_4_lens_modeling.py): (no summary in script docstring)
- Contents: Lens modelling with a pixelized source, Giving the inversion an incorrect mass model, Comparing with the correct mass model, Seeing how the mass model changes the mappings, Why evidence does not remove the search difficulty, Starting with a simpler source model, Running and inspecting the initial search, Requiring corresponding images to trace together, Replacing the analytic source with a pixelization, Running the pixelized-source search, Establishing the foreground light model, Using that result in the pixelized-source fit
- [Tutorial 8: Adaptive Pixelization](scripts/chapter_3_pixelizations/tutorial_8_adaptive_pixelization.py): In this tutorial we will introduce a new `Pixelization` object, which uses an `Overlay` image-mesh and a `Delaunay` mesh.
- Contents: Initial Setup, Advantages and Disadvantages, Image Mesh, Regularization, Wrap Up
- Contents: Initial Setup, Advantages and Disadvantages, Image Mesh, Regularization, Source Compactness, Wrap Up

## chapter_4_scaling_up_lensing

Expand Down
127 changes: 49 additions & 78 deletions notebooks/chapter_2_lens_modeling/tutorial_1_non_linear_search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,51 +38,9 @@
"- **Result:** Inspect the inferred parameters and fitted image.\n",
"- **Inspecting the Fit:** Compare the predicted image with the data and residuals.\n",
"- **Other Searches:** Find the optional optimisation and MCMC examples.\n",
"- **Wrap Up:** Review the lesson and its connection to the next topic."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Google Colab Setup__\n",
"\n",
"Set up Google Colab as in [the introductory notebook](https://github.com/PyAutoLabs/HowToLens/blob/main/notebooks/chapter_1_introduction/tutorial_1_grids_and_galaxies.ipynb).\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"jupyter": {
"source_hidden": true
}
},
"outputs": [],
"source": [
"# @title Set up Google Colab { display-mode: \"form\" }\n",
"try:\n",
" import google.colab\n",
"except ImportError:\n",
" from autolens import setup_colab as _setup_colab\n",
"else:\n",
" import importlib\n",
" import subprocess\n",
" import sys\n",
"- **Wrap Up:** Review the lesson and its connection to the next topic.\n",
"\n",
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtolens\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Overview__\n",
"\n",
"This tutorial introduces the main pieces of an automated model fit:\n",
Expand All @@ -93,13 +51,8 @@
"- The **search** explores parameter space using this likelihood and the specified priors.\n",
"\n",
"We will explain parameter spaces, likelihood surfaces and priors, then use Nautilus to fit the model and inspect its\n",
"inferred parameters and uncertainties."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"inferred parameters and uncertainties.\n",
"\n",
"__Parameter Space__\n",
"\n",
"Imagine varying just two properties of a lens model: the lens\u2019s Einstein radius and the source\u2019s effective radius. Each\n",
Expand All @@ -118,13 +71,8 @@
"also consistent with the observations.\n",
"\n",
"**\ud83e\udd16 Ask AI:** In strong-lens modeling, why might changing the lens mass and the source size together produce similar\n",
"images, and how could this appear on a likelihood surface?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"images, and how could this appear on a likelihood surface?\n",
"\n",
"__Automated Exploration__\n",
"\n",
"A non-linear search automates the exploration you performed manually in Chapter 1.\n",
Expand All @@ -134,13 +82,8 @@
"\n",
"Automating this process allows us to evaluate many more models than we could inspect by hand. It does not guarantee\n",
"that every search finds the best solution: its starting conditions, settings and the structure of parameter space all\n",
"matter. We will see examples of this later in the chapter."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"matter. We will see examples of this later in the chapter.\n",
"\n",
"__Deeper Background__\n",
"\n",
"The explanations here introduce what the search does and how to interpret its results. You do not need to understand\n",
Expand All @@ -155,6 +98,44 @@
"- [A Zero-Math Introduction to MCMC Methods](https://towardsdatascience.com/a-zero-math-introduction-to-markov-chain-monte-carlo-methods-dcba889e0c50)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"__Google Colab Setup__\n",
"\n",
"Set up Google Colab as in [the introductory notebook](https://github.com/PyAutoLabs/HowToLens/blob/main/notebooks/chapter_1_introduction/tutorial_1_grids_and_galaxies.ipynb).\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"jupyter": {
"source_hidden": true
}
},
"outputs": [],
"source": [
"# @title Set up Google Colab { display-mode: \"form\" }\n",
"try:\n",
" import google.colab\n",
"except ImportError:\n",
" from autolens import setup_colab as _setup_colab\n",
"else:\n",
" import importlib\n",
" import subprocess\n",
" import sys\n",
"\n",
" subprocess.check_call(\n",
" [sys.executable, \"-m\", \"pip\", \"install\", \"autonerves\", \"--no-deps\"]\n",
" )\n",
" _setup_colab = importlib.import_module(\"autonerves.setup_colab\")\n",
"\n",
"_setup_colab.setup(\"howtolens\")"
]
},
{
"cell_type": "code",
"metadata": {},
Expand Down Expand Up @@ -561,13 +542,8 @@
"range of possible solutions, allowing us to find a best-fitting model and estimate how uncertain its parameters are.\n",
"\n",
"Nautilus uses a method called **nested sampling**. You do not need to understand its statistical details to work\n",
"through HowToLens. Here, we will focus on configuring a fit and interpreting what it returns."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"through HowToLens. Here, we will focus on configuring a fit and interpreting what it returns.\n",
"\n",
"__Search Settings__\n",
"\n",
"One of Nautilus\u2019s main settings is `n_live`, the number of \u201clive points\u201d. Each live point represents a set of model\n",
Expand Down Expand Up @@ -698,13 +674,8 @@
"running a more thorough Nautilus search.\n",
"\n",
"You can explore these alternatives in the optional searches tutorial after completing HowToLens. For now, focus on\n",
"building appropriate models and assessing how well they explain the data."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"building appropriate models and assessing how well they explain the data.\n",
"\n",
"__Wrap Up__\n",
"\n",
"You have now fitted a lens model automatically, using the same image prediction and likelihood calculation that you\n",
Expand Down
Loading
Loading