Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
arturtoshev committed Dec 16, 2024
1 parent 463912a commit 094f334
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 6 deletions.
Binary file removed _images/ad_example_question.png
Binary file not shown.
Binary file removed _images/ad_example_solution.png
Binary file not shown.
Binary file added _images/gradients_example_question.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/gradients_example_solution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions _sources/lecture/gradients.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Reverse-mode differentiation. (Source: {cite}`maclaurin2016`, Section 2)
Given is the linear model $h(x)=w \cdot x+b$ that maps from the input $x\in \mathbb{R}$ to the output $y\in \mathbb{R}$, as well as a dataset of a single measurement pair $\{(x=1, y=7)\}$. The initial model parameters are $w=2, b=3$. Compute the gradient of the MSE loss w.r.t. the model parameters, and run one step of gradient descent with step size $0.1$. Draw all intermediate values in the provided compute graph below.
```{figure} ../imgs/gradients/ad_example_question.png
```{figure} ../imgs/gradients/gradients_example_question.png
---
width: 600px
align: center
Expand All @@ -114,7 +114,7 @@ x &= 1; \; w=2; \; b=3; \; y=7 \\
\end{align}
$$ (ad_example_forward)
```{figure} ../imgs/gradients/ad_example_solution.png
```{figure} ../imgs/gradients/gradients_example_solution.png
---
width: 600px
align: center
Expand Down
4 changes: 2 additions & 2 deletions exercise/bayes.html
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,8 @@ <h3><span class="section-number">2.1.4. </span>Bayesian Linear Regression Model<
<p>The model below essentially makes the following prior assumptions:</p>
<div class="math notranslate nohighlight">
\[y \approx h(x) = wx + b + \epsilon, \quad \text{with:}\]</div>
<div class="amsmath math notranslate nohighlight" id="equation-f32170e5-ffb0-457e-840a-2ee94804d3ea">
<span class="eqno">(2.30)<a class="headerlink" href="#equation-f32170e5-ffb0-457e-840a-2ee94804d3ea" title="Permalink to this equation">#</a></span>\[\begin{align}
<div class="amsmath math notranslate nohighlight" id="equation-762ca762-c6e7-49ee-ae7d-1206a8e34025">
<span class="eqno">(2.30)<a class="headerlink" href="#equation-762ca762-c6e7-49ee-ae7d-1206a8e34025" title="Permalink to this equation">#</a></span>\[\begin{align}
y_i &amp;\sim \mathcal{N}(\mu, \sigma^2)\\
\mu &amp;= w \cdot x_i + b\\
w &amp;\sim \mathcal{N}(0,1^2)\\
Expand Down
4 changes: 2 additions & 2 deletions lecture/gradients.html
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ <h3><span class="section-number">8.2.2. </span>Reverse-Mode Differentiation (Bac
<p><strong>Example: AD on a Linear Model</strong></p>
<p>Given is the linear model <span class="math notranslate nohighlight">\(h(x)=w \cdot x+b\)</span> that maps from the input <span class="math notranslate nohighlight">\(x\in \mathbb{R}\)</span> to the output <span class="math notranslate nohighlight">\(y\in \mathbb{R}\)</span>, as well as a dataset of a single measurement pair <span class="math notranslate nohighlight">\(\{(x=1, y=7)\}\)</span>. The initial model parameters are <span class="math notranslate nohighlight">\(w=2, b=3\)</span>. Compute the gradient of the MSE loss w.r.t. the model parameters, and run one step of gradient descent with step size <span class="math notranslate nohighlight">\(0.1\)</span>. Draw all intermediate values in the provided compute graph below.</p>
<figure class="align-center" id="ad-example-question">
<a class="reference internal image-reference" href="../_images/ad_example_question.png"><img alt="../_images/ad_example_question.png" src="../_images/ad_example_question.png" style="width: 600px;" /></a>
<a class="reference internal image-reference" href="../_images/gradients_example_question.png"><img alt="../_images/gradients_example_question.png" src="../_images/gradients_example_question.png" style="width: 600px;" /></a>
<figcaption>
<p><span class="caption-number">Fig. 8.3 </span><span class="caption-text">AD example.</span><a class="headerlink" href="#ad-example-question" title="Permalink to this image">#</a></p>
</figcaption>
Expand All @@ -529,7 +529,7 @@ <h3><span class="section-number">8.2.2. </span>Reverse-Mode Differentiation (Bac
\end{align}
\end{split}\]</div>
<figure class="align-center" id="ad-example-solution">
<a class="reference internal image-reference" href="../_images/ad_example_solution.png"><img alt="../_images/ad_example_solution.png" src="../_images/ad_example_solution.png" style="width: 600px;" /></a>
<a class="reference internal image-reference" href="../_images/gradients_example_solution.png"><img alt="../_images/gradients_example_solution.png" src="../_images/gradients_example_solution.png" style="width: 600px;" /></a>
<figcaption>
<p><span class="caption-number">Fig. 8.4 </span><span class="caption-text">AD example, solution.</span><a class="headerlink" href="#ad-example-solution" title="Permalink to this image">#</a></p>
</figcaption>
Expand Down

0 comments on commit 094f334

Please sign in to comment.