From 8fed9aee14da93d00d12716c6f12f1219a8112cd Mon Sep 17 00:00:00 2001 From: Jesse Michel Date: Sun, 16 Nov 2025 21:54:23 -0500 Subject: [PATCH 1/2] fix typo --- labs/lab_two.ipynb | 2 +- solutions/lab_two_complete.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/labs/lab_two.ipynb b/labs/lab_two.ipynb index 55561f4..04c0bcb 100644 --- a/labs/lab_two.ipynb +++ b/labs/lab_two.ipynb @@ -798,7 +798,7 @@ "id": "3b3744cf-1ba6-438c-9e53-25e823ce696f", "metadata": {}, "source": [ - "We can now sample from, and thus visualize, the *conditional* probaability path." + "We can now sample from, and thus visualize, the *conditional* probability path." ] }, { diff --git a/solutions/lab_two_complete.ipynb b/solutions/lab_two_complete.ipynb index 78701b3..6a15c8b 100644 --- a/solutions/lab_two_complete.ipynb +++ b/solutions/lab_two_complete.ipynb @@ -806,7 +806,7 @@ "id": "3b3744cf-1ba6-438c-9e53-25e823ce696f", "metadata": {}, "source": [ - "We can now sample from, and thus visualize, the *conditional* probaability path." + "We can now sample from, and thus visualize, the *conditional* probability path." ] }, { From bdc8e938933c468a90c944c2fd4add36a0e8c46f Mon Sep 17 00:00:00 2001 From: Jesse Michel Date: Thu, 27 Nov 2025 17:16:29 -0500 Subject: [PATCH 2/2] Minor --- labs/lab_two.ipynb | 2 +- solutions/lab_two_complete.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/labs/lab_two.ipynb b/labs/lab_two.ipynb index 04c0bcb..ccb7834 100644 --- a/labs/lab_two.ipynb +++ b/labs/lab_two.ipynb @@ -1564,7 +1564,7 @@ "metadata": {}, "source": [ "We have thus far used flow matching to train a model $u_t^{\\theta}(x) \\approx u_t^{\\text{ref}}$ so that $$d X_t = u_t^{\\theta}(X_t) dt $$ approximately passes through the desired marginal probability path $p_t(x)$. Now recall from lecture that we may augment the reference marginal vector field $u_t^{\\text{ref}}(x)$ with *Langevin dynamics* to add stochasticity while preserving the marginals, viz., $$dX_t = \\left[u_t^{\\text{ref}}(x) + \\frac{1}{2}\\sigma^2 \\nabla \\log p_t(x)\\right] dt + \\sigma d W_t.$$\n", - "Substituting our learned approximation $u_t^{\\theta}(x) \\approx u_t^{\\text{ref}}$ therefore yields \n", + "Substituting our learned approximation $u_t^{\\theta}(x) \\approx u_t^{\\text{ref}}(x)$ therefore yields \n", "$$dX_t = \\left[u_t^{\\theta}(x) + \\frac{1}{2}\\sigma^2 \\nabla \\log p_t(x)\\right] dt + \\sigma d W_t.$$\n", "There's just one issue, what's the marginal score $\\nabla \\log p_t(x)$? In Question 2.3, we computed the conditional score $\\nabla \\log p_t(x|z)$ of the Gaussian probability path. In the same way that we learned an approximation $u_t^{\\theta}(x) \\approx u_t^{\\text{ref}}$, we'd like to be able to learn a similar approximation $s_t^{\\theta}(x) \\approx \\nabla \\log p_t(x)$. Recall from lecture the identity $$\\nabla \\log p_t(x) = \\mathbb{E}_{z \\sim p_t(z|x)}\\left[\\nabla \\log p_t(x|z) \\right].$$ It then immediately follows that\n", "$$\\nabla \\log p_t(x) = \\text{argmin}_{s_t(x)} \\,\\,\\mathbb{E}_{z \\sim p(z), x \\sim p_t(x|z)} \\left[\\lVert s_t(x) - \\nabla \\log p_t(x|z)\\rVert^2\\right].$$\n", diff --git a/solutions/lab_two_complete.ipynb b/solutions/lab_two_complete.ipynb index 6a15c8b..652ba34 100644 --- a/solutions/lab_two_complete.ipynb +++ b/solutions/lab_two_complete.ipynb @@ -1578,7 +1578,7 @@ "metadata": {}, "source": [ "We have thus far used flow matching to train a model $u_t^{\\theta}(x) \\approx u_t^{\\text{ref}}$ so that $$d X_t = u_t^{\\theta}(X_t) dt $$ approximately passes through the desired marginal probability path $p_t(x)$. Now recall from lecture that we may augment the reference marginal vector field $u_t^{\\text{ref}}(x)$ with *Langevin dynamics* to add stochasticity while preserving the marginals, viz., $$dX_t = \\left[u_t^{\\text{ref}}(x) + \\frac{1}{2}\\sigma^2 \\nabla \\log p_t(x)\\right] dt + \\sigma d W_t.$$\n", - "Substituting our learned approximation $u_t^{\\theta}(x) \\approx u_t^{\\text{ref}}$ therefore yields \n", + "Substituting our learned approximation $u_t^{\\theta}(x) \\approx u_t^{\\text{ref}}(x)$ therefore yields \n", "$$dX_t = \\left[u_t^{\\theta}(x) + \\frac{1}{2}\\sigma^2 \\nabla \\log p_t(x)\\right] dt + \\sigma d W_t.$$\n", "There's just one issue, what's the marginal score $\\nabla \\log p_t(x)$? In Question 2.3, we computed the conditional score $\\nabla \\log p_t(x|z)$ of the Gaussian probability path. In the same way that we learned an approximation $u_t^{\\theta}(x) \\approx u_t^{\\text{ref}}$, we'd like to be able to learn a similar approximation $s_t^{\\theta}(x) \\approx \\nabla \\log p_t(x)$. Recall from lecture the identity $$\\nabla \\log p_t(x) = \\mathbb{E}_{z \\sim p_t(z|x)}\\left[\\nabla \\log p_t(x|z) \\right].$$ It then immediately follows that\n", "$$\\nabla \\log p_t(x) = \\text{argmin}_{s_t(x)} \\,\\,\\mathbb{E}_{z \\sim p(z), x \\sim p_t(x|z)} \\left[\\lVert s_t(x) - \\nabla \\log p_t(x|z)\\rVert^2\\right].$$\n",