 bondscell_results O$cf264b86-d86f-4c4a-af3b-03b34486e5ffqueued¤logsrunning¦outputbody<div class="markdown"><h3 id="Visualization">Visualization</h3>
<p>Let&#39;s test our optimizers. We will simulate a loss function that depends on two parameters using the 2D Rosenbrock function:</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(OHpersist_js_state·has_pluto_hook_features§cell_id$cf264b86-d86f-4c4a-af3b-03b34486e5ffdepends_on_disabled_cells§runtime Bpublished_object_keysdepends_on_skipped_cells§errored$ac1355a2-db94-4954-ad65-6887b7dbb7adqueued¤logsrunning¦outputbodymsg-UndefVarError: `transformed_data` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#ac1355a2-db94-4954-ad65-6887b7dbb7adsource_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#ac1355a2-db94-4954-ad65-6887b7dbb7adfunctop-level scopeparent_modulefrom_c«plain_errorUndefVarError: `transformed_data` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#ac1355a2-db94-4954-ad65-6887b7dbb7ad:1mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampA(|ZUpersist_js_state·has_pluto_hook_features§cell_id$ac1355a2-db94-4954-ad65-6887b7dbb7addepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$3a100e93-7bba-4836-a4e6-e285aa6406c4queued¤logsrunning¦outputbodyprefixFloat64elements -2.463text/plain-0.934text/plain-1.854text/plain-3.875text/plain2.477text/plain-1.1875text/plain-1.158text/plain-1.224text/plain	-1.344text/plain
-0.319text/plain-0.525text/plain-1.388text/plain-1.837text/plain-1.316text/plain-0.597text/plain-1.068text/plain0.1412text/plain-0.959text/plain-1.479text/plain-2.004text/plainmore)-1.969text/plain*-1.564text/plain+-0.982text/plain,-1.238text/plain--1.414text/plain.-2.246text/plain/-2.925text/plain0-1.3955text/plain1-1.237text/plain2-1.005text/plaintypeArrayprefix_shortobjectidcc312cd7308844ddmime!application/vnd.pluto.tree+objectrootassigneetest_datalast_run_timestampA({persist_js_state·has_pluto_hook_features§cell_id$3a100e93-7bba-4836-a4e6-e285aa6406c4depends_on_disabled_cells§runtime.published_object_keysdepends_on_skipped_cells§errored$80c5a262-e758-4075-896f-a0bc7ce1534cqueued¤logsrunning¦outputbodyD<div class="markdown"><p>Let&#39;s see if our code works:</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(ݕJpersist_js_state·has_pluto_hook_features§cell_id$80c5a262-e758-4075-896f-a0bc7ce1534cdepends_on_disabled_cells§runtime Qpublished_object_keysdepends_on_skipped_cells§errored$8b519a7d-b64f-4c0c-8d74-17a963cb381dqueued¤logsrunning¦outputbodyٺ<div class="markdown"><div class="admonition tip"><p class="admonition-title">Tip</p><p>It is recommended to quickly review exercise 3 from homework 1 before starting.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA({4persist_js_state·has_pluto_hook_features§cell_id$8b519a7d-b64f-4c0c-8d74-17a963cb381ddepends_on_disabled_cells§runtimeѵpublished_object_keysdepends_on_skipped_cells§errored$0fbd2560-1e4c-45b7-89a6-d2b622f9f907queued¤logsrunning¦outputbody2plot_loss_surface (generic function with 1 method)mimetext/plainrootassigneelast_run_timestampA(|/<persist_js_state·has_pluto_hook_features§cell_id$0fbd2560-1e4c-45b7-89a6-d2b622f9f907depends_on_disabled_cells§runtime gpublished_object_keysdepends_on_skipped_cells§errored$ff5d316f-806c-4652-97d8-323462395c69queued¤logsrunning¦outputbodyٚ<div class="markdown"><p>Submission by: <strong><em>Mara Mustermann</em></strong> &#40;m.mustermann@campus.tu-berlin.de, Matr.-Nr.: 456123&#41;</p>
</div>mimetext/htmlrootassigneelast_run_timestampA({'aNpersist_js_state·has_pluto_hook_features§cell_id$ff5d316f-806c-4652-97d8-323462395c69depends_on_disabled_cells§runtimeDpublished_object_keysdepends_on_skipped_cells§errored$e5e014e6-e24d-4de0-a216-61c0f9d9c331queued¤logsrunning¦outputbodymsgUndefVarError: `dt` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#e5e014e6-e24d-4de0-a216-61c0f9d9c331source_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#e5e014e6-e24d-4de0-a216-61c0f9d9c331functop-level scopeparent_modulefrom_c«plain_errorٲUndefVarError: `dt` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#e5e014e6-e24d-4de0-a216-61c0f9d9c331:1mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampA(|Tpersist_js_state·has_pluto_hook_features§cell_id$e5e014e6-e24d-4de0-a216-61c0f9d9c331depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$02a62f7b-6014-439a-a254-49f53f204abbqueued¤logsrunning¦outputbodyْ<div class="markdown"><h3 id="Exercise-1.1-–-Composite-types-&amp;-constructors">Exercise 1.1 – Composite types &amp; constructors</h3>
</div>mimetext/htmlrootassigneelast_run_timestampA(Clpersist_js_state·has_pluto_hook_features§cell_id$02a62f7b-6014-439a-a254-49f53f204abbdepends_on_disabled_cells§runtime E۵published_object_keysdepends_on_skipped_cells§errored$bcdd297b-c52c-4076-9329-929d69b8021bqueued¤logsrunning¦outputbodyW<div class="markdown"><h3 id="Visualization">Visualization</h3>
<p>As we can see in this plot, our original data didn&#39;t come from a normal distribution. Standardization transforms the data such that <span class="tex">$\mu &#61; 0$</span> and <span class="tex">$\sigma&#61;1$</span>, but doesn&#39;t make it normally distributed.</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(persist_js_state·has_pluto_hook_features§cell_id$bcdd297b-c52c-4076-9329-929d69b8021bdepends_on_disabled_cells§runtime `published_object_keysdepends_on_skipped_cells§errored$3f81ccce-5744-42ba-aa1e-b3da6212b9efqueued¤logsrunning¦outputbodymsg'UndefVarError: `optimizers` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#3f81ccce-5744-42ba-aa1e-b3da6212b9efsource_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#3f81ccce-5744-42ba-aa1e-b3da6212b9effunctop-level scopeparent_modulefrom_c«plain_errorٺUndefVarError: `optimizers` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#3f81ccce-5744-42ba-aa1e-b3da6212b9ef:1mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampA( Kpersist_js_state·has_pluto_hook_features§cell_id$3f81ccce-5744-42ba-aa1e-b3da6212b9efdepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$a3634333-1149-4392-a7e9-350a56d67d2bqueued¤logsrunning¦outputbody0plot_trajectory (generic function with 1 method)mimetext/plainrootassigneelast_run_timestampA([persist_js_state·has_pluto_hook_features§cell_id$a3634333-1149-4392-a7e9-350a56d67d2bdepends_on_disabled_cells§runtime =Npublished_object_keysdepends_on_skipped_cells§errored$be2c5285-fbd8-4c37-8b17-db6db95c8a4equeued¤logsrunning¦outputbody<div class="markdown"><div class="admonition Task"><p class="admonition-title">Task (2 points)</p><p>Now define two functions <code>transform</code> and <code>inverse_transform</code>:</p>
<ol>
<li><p>A function <code>transform</code> that takes an array and a <code>Standardize</code> object and implements the standardization</p>
</li>
</ol>
<p class="tex">$$X&#39; &#61; \frac&#123;X-\mu&#125;&#123;\sigma&#125; \quad .$$</p>
<ol start="2">
<li><p>A function <code>inverse_transform</code> that takes an array and a <code>Standardize</code> object and implements the inverse standardization</p>
</li>
</ol>
<p class="tex">$$X &#61; \left&#40;X&#39; \cdot \sigma\right&#41; &#43; \mu \quad .$$</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|>S;persist_js_state·has_pluto_hook_features§cell_id$be2c5285-fbd8-4c37-8b17-db6db95c8a4edepends_on_disabled_cells§runtime k[published_object_keysdepends_on_skipped_cells§errored$ef9a0669-2d02-4f1b-aa99-6f6473d37c0fqueued¤logsrunning¦outputbody)<div class="markdown"><div class="admonition Task"><p class="admonition-title">Task (2 points)</p><p>Define a type <code>GradientDescent</code> that implements <a href="https://en.wikipedia.org/wiki/Gradient_descent">gradient descent</a>. It should:</p>
<ul>
<li><p>be a sub-type of <code>AbstractRule</code></p>
</li>
<li><p>have a learning rate <code>lr</code> as its only field</p>
</li>
<li><p>have a default learning rate of <code>0.1</code>, implemented in an outer constructor <code>GradientDescent&#40;&#41;</code></p>
</li>
</ul>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|gZpersist_js_state·has_pluto_hook_features§cell_id$ef9a0669-2d02-4f1b-aa99-6f6473d37c0fdepends_on_disabled_cells§runtime 
published_object_keysdepends_on_skipped_cells§errored$aaea0bbf-868d-4fe0-b348-307449d06517queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampA({persist_js_state·has_pluto_hook_features§cell_id$aaea0bbf-868d-4fe0-b348-307449d06517depends_on_disabled_cells§runtime"ߵpublished_object_keysdepends_on_skipped_cells§errored$c080e799-b5c5-42cf-b5f1-8c36da89fc8fqueued¤logsrunning¦outputbodyo<div class="markdown"><h3 id="Exercise-2.3-–-apply&#33;">Exercise 2.3 – <code>apply&#33;</code></h3>
</div>mimetext/htmlrootassigneelast_run_timestampA('persist_js_state·has_pluto_hook_features§cell_id$c080e799-b5c5-42cf-b5f1-8c36da89fc8fdepends_on_disabled_cells§runtime Ȟpublished_object_keysdepends_on_skipped_cells§errored$569173af-9e54-49cb-b1cb-88b8cbda57a6queued¤logsrunning¦outputbodyy<div class="markdown"><p>And let&#39;s test the inverse transformation. The following vectors should be equal:</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(apersist_js_state·has_pluto_hook_features§cell_id$569173af-9e54-49cb-b1cb-88b8cbda57a6depends_on_disabled_cells§runtime 7published_object_keysdepends_on_skipped_cells§errored$f60be2e0-9b43-46b5-96ef-7747ab56e164queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampA(~persist_js_state·has_pluto_hook_features§cell_id$f60be2e0-9b43-46b5-96ef-7747ab56e164depends_on_disabled_cells§runtime7}published_object_keysdepends_on_skipped_cells§errored$dc35d701-ab40-4933-b4c5-35a81b3f834aqueued¤logsrunning¦outputbody_<bond def="lr1" unique_id="lnybpawiilxv"><input type='range' min='1' max='20' value='15'><script>
					const input_el = currentScript.previousElementSibling
					const output_el = currentScript.nextElementSibling
					const displays = ["0.01", "0.02", "0.03", "0.04", "0.05", "0.06", "0.07", "0.08", "0.09", "0.1", "0.11", "0.12", "0.13", "0.14", "0.15", "0.16", "0.17", "0.18", "0.19", "0.2"]

					let update_output = () => {
						output_el.value = displays[input_el.valueAsNumber - 1]
					}
					
					input_el.addEventListener("input", update_output)
					// We also poll for changes because the `input_el.value` can change from the outside, e.g. https://github.com/JuliaPluto/PlutoUI.jl/issues/277
					let id = setInterval(update_output, 200)
					invalidation.then(() => {
						clearInterval(id)
						input_el.removeEventListener("input", update_output)
					})
					</script><output style='
						font-family: system-ui;
						font-variant-numeric: tabular-nums;
    					font-size: 15px;
    					margin-left: 3px;
    					transform: translateY(-4px);
    					display: inline-block;'>0.15</output></bond>mimetext/htmlrootassigneelast_run_timestampA(7persist_js_state·has_pluto_hook_features§cell_id$dc35d701-ab40-4933-b4c5-35a81b3f834adepends_on_disabled_cells§runtime5published_object_keysdepends_on_skipped_cells§errored$a96abf48-cacf-41f8-bb7a-3d085bdb0a62queued¤logsrunning¦outputbody<div class="markdown"><p>You can also implement <a href="https://en.wikipedia.org/wiki/Stochastic_gradient_descent#Extensions_and_variants">more variants</a> or simply use <a href="https://fluxml.ai/Optimisers.jl/dev/api/#Optimisation-Rules">those implemented in Optimisers.jl</a>.</p>
<p>Click <code>plot_trajectory</code> below to reveal the code that produced the plot. The most relevant part is the inner loop where the optimizer is called:</p>
<pre><code class="language-julia">state &#61; Optimisers.setup&#40;opt, params&#41;

for i in 1:steps
	grad &#61; ... # Compute gradient. We will learn how this works next week.

	state, params &#61; Optimisers.update&#40;state, params, grad&#41;
end</code></pre>
</div>mimetext/htmlrootassigneelast_run_timestampA(persist_js_state·has_pluto_hook_features§cell_id$a96abf48-cacf-41f8-bb7a-3d085bdb0a62depends_on_disabled_cells§runtime յpublished_object_keysdepends_on_skipped_cells§errored$58a671a1-3059-4fa9-b758-f3a76a573aa5queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampA(persist_js_state·has_pluto_hook_features§cell_id$58a671a1-3059-4fa9-b758-f3a76a573aa5depends_on_disabled_cells§runtime ˵published_object_keysdepends_on_skipped_cells§errored$4eac0e3f-7212-4038-a24e-8d6ca3fbe659queued¤logsrunning¦outputbody<div class="markdown"><div class="admonition danger"><p class="admonition-title">Keep working on it!</p><p>Make sure that you define a struct called <code>GradientDescent</code>.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|i=dpersist_js_state·has_pluto_hook_features§cell_id$4eac0e3f-7212-4038-a24e-8d6ca3fbe659depends_on_disabled_cells§runtime &published_object_keysdepends_on_skipped_cells§errored$3d638561-6760-4260-991a-b0b0c77745a3queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampA(z/ϰpersist_js_state·has_pluto_hook_features§cell_id$3d638561-6760-4260-991a-b0b0c77745a3depends_on_disabled_cells§runtime Upublished_object_keysdepends_on_skipped_cells§errored$17ff11e9-84f8-4911-845b-930a53c73e0equeued¤logsrunning¦outputbodymsgUndefVarError: `dt` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#17ff11e9-84f8-4911-845b-930a53c73e0esource_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#17ff11e9-84f8-4911-845b-930a53c73e0efunctop-level scopeparent_modulefrom_c«plain_errorٲUndefVarError: `dt` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#17ff11e9-84f8-4911-845b-930a53c73e0e:1mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampA(|"persist_js_state·has_pluto_hook_features§cell_id$17ff11e9-84f8-4911-845b-930a53c73e0edepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$3ac8faba-1af9-4fc6-a1d0-37225b9ebb02queued¤logsrunning¦outputbody<div class="markdown"><h2 id="Exercise-2-–-Gradient-based-optimization">Exercise 2 – Gradient-based optimization</h2>
<p>As we have seen in the previous exercise, structs / composite types are a common way to implement algorithms. In this exercise, we will extend the <a href="https://en.wikipedia.org/wiki/Gradient_descent">gradient-based optimization algorithms</a> from <a href="https://github.com/FluxML/Optimisers.jl/">Optimisers.jl</a>.</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(Apersist_js_state·has_pluto_hook_features§cell_id$3ac8faba-1af9-4fc6-a1d0-37225b9ebb02depends_on_disabled_cells§runtime Xյpublished_object_keysdepends_on_skipped_cells§errored$bb0d58f9-380e-43fa-9524-0108a2816884queued¤logsrunning¦outputbodymsg(UndefVarError: `Standardize` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#bb0d58f9-380e-43fa-9524-0108a2816884source_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#bb0d58f9-380e-43fa-9524-0108a2816884functop-level scopeparent_modulefrom_c«plain_errorٻUndefVarError: `Standardize` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#bb0d58f9-380e-43fa-9524-0108a2816884:1mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampA(|GKpersist_js_state·has_pluto_hook_features§cell_id$bb0d58f9-380e-43fa-9524-0108a2816884depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$5061a130-fc0a-4306-bdf5-6966e8de938aqueued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampA({fOưpersist_js_state·has_pluto_hook_features§cell_id$5061a130-fc0a-4306-bdf5-6966e8de938adepends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$ddd6e83e-5a0d-4ff0-afe4-dedfc860994cqueued¤logsrunning¦outputbodyR<div class="markdown"><h3 id="Student-information">Student information</h3>
</div>mimetext/htmlrootassigneelast_run_timestampA(persist_js_state·has_pluto_hook_features§cell_id$ddd6e83e-5a0d-4ff0-afe4-dedfc860994cdepends_on_disabled_cells§runtime Pʵpublished_object_keysdepends_on_skipped_cells§errored$f9192279-9d12-485e-bb9d-650be2dbd878queued¤logsrunning¦outputbody~<bond def="lr2" unique_id="szgegaquthch"><input type='range' min='1' max='50' value='10'><script>
					const input_el = currentScript.previousElementSibling
					const output_el = currentScript.nextElementSibling
					const displays = ["0.001", "0.002", "0.003", "0.004", "0.005", "0.006", "0.007", "0.008", "0.009", "0.01", "0.011", "0.012", "0.013", "0.014", "0.015", "0.016", "0.017", "0.018", "0.019", "0.02", "0.021", "0.022", "0.023", "0.024", "0.025", "0.026", "0.027", "0.028", "0.029", "0.03", "0.031", "0.032", "0.033", "0.034", "0.035", "0.036", "0.037", "0.038", "0.039", "0.04", "0.041", "0.042", "0.043", "0.044", "0.045", "0.046", "0.047", "0.048", "0.049", "0.05"]

					let update_output = () => {
						output_el.value = displays[input_el.valueAsNumber - 1]
					}
					
					input_el.addEventListener("input", update_output)
					// We also poll for changes because the `input_el.value` can change from the outside, e.g. https://github.com/JuliaPluto/PlutoUI.jl/issues/277
					let id = setInterval(update_output, 200)
					invalidation.then(() => {
						clearInterval(id)
						input_el.removeEventListener("input", update_output)
					})
					</script><output style='
						font-family: system-ui;
						font-variant-numeric: tabular-nums;
    					font-size: 15px;
    					margin-left: 3px;
    					transform: translateY(-4px);
    					display: inline-block;'>0.01</output></bond>mimetext/htmlrootassigneelast_run_timestampA($persist_js_state·has_pluto_hook_features§cell_id$f9192279-9d12-485e-bb9d-650be2dbd878depends_on_disabled_cells§runtime X$published_object_keysdepends_on_skipped_cells§errored$78fcd02f-1a6e-4799-b042-4542a1ec7847queued¤logsrunning¦outputbodymsgUndefVarError: `dt` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#78fcd02f-1a6e-4799-b042-4542a1ec7847source_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#78fcd02f-1a6e-4799-b042-4542a1ec7847functop-level scopeparent_modulefrom_c«plain_errorٲUndefVarError: `dt` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#78fcd02f-1a6e-4799-b042-4542a1ec7847:1mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampA(|fkpersist_js_state·has_pluto_hook_features§cell_id$78fcd02f-1a6e-4799-b042-4542a1ec7847depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$2341dd4a-a35a-4a62-815a-e972d04844abqueued¤logsrunning¦outputbody<div class="markdown"><p>Let&#39;s plot the trajectory of our optimizers on the &quot;loss surface&quot;.</p>
<p>Add as many optimizers and sliders as you want, change the initial parameters and the number of steps taken.</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(x`persist_js_state·has_pluto_hook_features§cell_id$2341dd4a-a35a-4a62-815a-e972d04844abdepends_on_disabled_cells§runtime Npublished_object_keysdepends_on_skipped_cells§errored$d36914f8-f7d4-407a-a842-436f4035157bqueued¤logsrunning¦outputbody<div class="markdown"><h2 id="Exercise-1-–-Standardization">Exercise 1 – Standardization</h2>
<p>In this exercise, we will refactor the standardization code from homework 1 by using custom types. Let&#39;s load the dataset from last time:</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(1persist_js_state·has_pluto_hook_features§cell_id$d36914f8-f7d4-407a-a842-436f4035157bdepends_on_disabled_cells§runtime Opublished_object_keysdepends_on_skipped_cells§errored$3b65f124-75c2-4fb3-8b59-94015500acbfqueued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampA(|{persist_js_state·has_pluto_hook_features§cell_id$3b65f124-75c2-4fb3-8b59-94015500acbfdepends_on_disabled_cells§runtimeVpublished_object_keysdepends_on_skipped_cells§errored$755b8685-0711-48a2-a3eb-f80af39f10e1queued¤logsrunning¦outputbodyprefixPlots.PlotlyBackendelementstypestructprefix_shortPlotlyBackendobjectidffffffff46862ef5mime!application/vnd.pluto.tree+objectrootassigneelast_run_timestampA(z5.persist_js_state·has_pluto_hook_features§cell_id$755b8685-0711-48a2-a3eb-f80af39f10e1depends_on_disabled_cells§runtime΀published_object_keysdepends_on_skipped_cells§errored$3bb76227-82cd-4924-bfb3-1b8504e2dc44queued¤logsrunning¦outputbody%loss (generic function with 1 method)mimetext/plainrootassigneelast_run_timestampA(|u(persist_js_state·has_pluto_hook_features§cell_id$3bb76227-82cd-4924-bfb3-1b8504e2dc44depends_on_disabled_cells§runtime 4published_object_keysdepends_on_skipped_cells§errored$5dc7d04d-f6a5-4265-b890-d74ea4b3c602queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampA(?հpersist_js_state·has_pluto_hook_features§cell_id$5dc7d04d-f6a5-4265-b890-d74ea4b3c602depends_on_disabled_cells§runtime!published_object_keysdepends_on_skipped_cells§errored$fd30da51-0890-4ebe-8b14-8975ec12fec0queued¤logsrunning¦outputbody<div class="markdown"><div class="admonition danger"><p class="admonition-title">Keep working on it!</p><p>Make sure that you define a struct called <code>Standardize</code>.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|8Bpersist_js_state·has_pluto_hook_features§cell_id$fd30da51-0890-4ebe-8b14-8975ec12fec0depends_on_disabled_cells§runtimeb%<published_object_keysdepends_on_skipped_cells§errored$8ece9aea-20f5-41db-95ca-08c8d4d2d4c1queued¤logsrunning¦outputbody٤<div class="markdown"><div class="admonition Task"><p class="admonition-title">Task </p><p>Please add your student information to the cell below.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA({nMpersist_js_state·has_pluto_hook_features§cell_id$8ece9aea-20f5-41db-95ca-08c8d4d2d4c1depends_on_disabled_cells§runtime Kpublished_object_keysdepends_on_skipped_cells§errored$b0d679ba-13f8-4e70-ac42-68acb2ff83d1queued¤logsrunning¦outputbodyD<div class="markdown"><div class="admonition Task"><p class="admonition-title">Task (1 point)</p><p>Define an <code>Optimisers.init</code> function for <code>GradientDescent</code> that returns <code>nothing</code>.</p>
<p>We return <code>nothing</code> since gradient descent doesn&#39;t require a state.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|h:persist_js_state·has_pluto_hook_features§cell_id$b0d679ba-13f8-4e70-ac42-68acb2ff83d1depends_on_disabled_cells§runtime Kpublished_object_keysdepends_on_skipped_cells§errored$f83196a4-a0fd-44a3-b3d1-29730599830dqueued¤logsrunning¦outputbodymsgUndefVarError: `dt` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#f83196a4-a0fd-44a3-b3d1-29730599830dsource_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#f83196a4-a0fd-44a3-b3d1-29730599830dfunctop-level scopeparent_modulefrom_c«plain_errorٲUndefVarError: `dt` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#f83196a4-a0fd-44a3-b3d1-29730599830d:1mime'application/vnd.pluto.stacktrace+objectrootassigneetransformed_datalast_run_timestampA(|R,persist_js_state·has_pluto_hook_features§cell_id$f83196a4-a0fd-44a3-b3d1-29730599830ddepends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$6d5bf1e5-5ab0-4351-89d0-ddb6fcfa27b6queued¤logsrunning¦outputbody<div class="markdown"><div class="admonition danger"><p class="admonition-title">Keep working on it!</p><p>Make sure that you define a struct called <code>GradientDescent</code>.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|g½persist_js_state·has_pluto_hook_features§cell_id$6d5bf1e5-5ab0-4351-89d0-ddb6fcfa27b6depends_on_disabled_cells§runtime x8published_object_keysdepends_on_skipped_cells§errored$822d03c6-48f8-47b0-8f25-b2de45e4c589queued¤logsrunning¦outputbodys<div class="markdown"><div class="admonition Task"><p class="admonition-title">Optional task</p><p>Implement the <em>Adam</em> optimizer, which was introduced             in <a href="https://arxiv.org/abs/1412.6980">this paper</a> by Kingma and Ba.             Add it to the visualization above and compare it to Optimizer.jl&#39;s Adam implementation.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA( x}persist_js_state·has_pluto_hook_features§cell_id$822d03c6-48f8-47b0-8f25-b2de45e4c589depends_on_disabled_cells§runtimeF*published_object_keysdepends_on_skipped_cells§errored$bebbf87b-cd7b-43d7-8025-938fc4c6944dqueued¤logsrunning¦outputbody<div class="markdown"><div class="admonition Task"><p class="admonition-title">Task (1 point)</p><p>Define an <code>Optimisers.apply&#33;</code> function for <code>GradientDescent</code> that</p>
<ul>
<li><p>doesn&#39;t modify the state &#40;since gradient descent doesn&#39;t require a state&#41;</p>
</li>
<li><p>scales the gradient by the learning rate</p>
</li>
</ul>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|hDpersist_js_state·has_pluto_hook_features§cell_id$bebbf87b-cd7b-43d7-8025-938fc4c6944ddepends_on_disabled_cells§runtime ipublished_object_keysdepends_on_skipped_cells§errored$c2adc38f-84e3-486f-93d8-b88eea63a09bqueued¤logsrunning¦outputbodyِ<div class="markdown"><h3 id="Exercise-1.2-–-Transform-&amp;-Inverse-transform">Exercise 1.2 – Transform &amp; Inverse transform</h3>
</div>mimetext/htmlrootassigneelast_run_timestampA(ݫpersist_js_state·has_pluto_hook_features§cell_id$c2adc38f-84e3-486f-93d8-b88eea63a09bdepends_on_disabled_cells§runtime v_published_object_keysdepends_on_skipped_cells§errored$5370c50b-a9b8-41dc-8cfe-1f0389df97c3queued¤logsrunning¦outputbodyl<div class="markdown"><h3 id="Optional-Task-–-Adam-optimizer">Optional Task – Adam optimizer</h3>
</div>mimetext/htmlrootassigneelast_run_timestampA(袱persist_js_state·has_pluto_hook_features§cell_id$5370c50b-a9b8-41dc-8cfe-1f0389df97c3depends_on_disabled_cells§runtime Spublished_object_keysdepends_on_skipped_cells§errored$32e8ee04-4378-4377-ae47-b65e5ce70667queued¤logsrunning¦outputbodyc<div class="markdown"><h3 id="Exercise-2.2-–-init">Exercise 2.2 – <code>init</code></h3>
</div>mimetext/htmlrootassigneelast_run_timestampA(persist_js_state·has_pluto_hook_features§cell_id$32e8ee04-4378-4377-ae47-b65e5ce70667depends_on_disabled_cells§runtime y~published_object_keysdepends_on_skipped_cells§errored$befba318-8595-4fc4-b42e-9c9125e7abfbqueued¤logsrunning¦outputbody<div class="markdown"><div class="admonition tip"><p class="admonition-title">Tip</p><p>Statefulness could also have been implemented by making the state a field in the struct of the optimizer and/or making the struct mutable.</p>
<p>However, mutable structs are usually less performant. The dimensionality of the state also often depends on the dimensionality of the input parameters we optimize over.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|fEpersist_js_state·has_pluto_hook_features§cell_id$befba318-8595-4fc4-b42e-9c9125e7abfbdepends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$d5052369-0b47-42e7-b661-058c7365c032queued¤logsrunning¦outputbody<div class="markdown"><div class="admonition tip"><p class="admonition-title">Tip</p><p><strong>Reminder:</strong> By convention, functions that modify their inputs in-place are given an exclamation point <code>&#33;</code> at the end of their name.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|g!persist_js_state·has_pluto_hook_features§cell_id$d5052369-0b47-42e7-b661-058c7365c032depends_on_disabled_cells§runtime Եpublished_object_keysdepends_on_skipped_cells§errored$cf3c52c7-fc5e-4191-be9d-394660385801queued¤logsrunning¦outputbodymsg(UndefVarError: `Standardize` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#cf3c52c7-fc5e-4191-be9d-394660385801source_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#cf3c52c7-fc5e-4191-be9d-394660385801functop-level scopeparent_modulefrom_c«plain_errorٻUndefVarError: `Standardize` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#cf3c52c7-fc5e-4191-be9d-394660385801:1mime'application/vnd.pluto.stacktrace+objectrootassigneedtlast_run_timestampA(|-4persist_js_state·has_pluto_hook_features§cell_id$cf3c52c7-fc5e-4191-be9d-394660385801depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$2cd9cef0-d746-411a-861f-b8a035f4a1d3queued¤logsrunning¦outputbodymsg-UndefVarError: `transformed_data` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#2cd9cef0-d746-411a-861f-b8a035f4a1d3source_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#2cd9cef0-d746-411a-861f-b8a035f4a1d3functop-level scopeparent_modulefrom_c«plain_errorUndefVarError: `transformed_data` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#2cd9cef0-d746-411a-861f-b8a035f4a1d3:1mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampA(|V0persist_js_state·has_pluto_hook_features§cell_id$2cd9cef0-d746-411a-861f-b8a035f4a1d3depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$d15eb189-6e4d-4c70-a1cb-159e6a4eb8ebqueued¤logsrunning¦outputbodyI<div class="markdown"><div class="admonition tip"><p class="admonition-title">Tip</p><p>Gradient descent is typically used in deep learning in combination with mini-batches, which introduce stochasticity.</p>
<p>This example had no stochasticity and other optimization algorithms would have been better suited.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(R7persist_js_state·has_pluto_hook_features§cell_id$d15eb189-6e4d-4c70-a1cb-159e6a4eb8ebdepends_on_disabled_cells§runtime S޵published_object_keysdepends_on_skipped_cells§errored$955a9751-38d0-4327-9a95-a0523c2d54b8queued¤logsrunning¦outputbodymsgUndefVarError: `dt` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#955a9751-38d0-4327-9a95-a0523c2d54b8source_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#955a9751-38d0-4327-9a95-a0523c2d54b8functop-level scopeparent_modulefrom_c«plain_errorٲUndefVarError: `dt` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#955a9751-38d0-4327-9a95-a0523c2d54b8:1mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampA(|)װpersist_js_state·has_pluto_hook_features§cell_id$955a9751-38d0-4327-9a95-a0523c2d54b8depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$62a1289b-ce6a-444d-8b20-92bd4fa3d05dqueued¤logsrunning¦outputbodya<div class="markdown"><p>For the purpose of plotting, we define a range of parameters:</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(dRpersist_js_state·has_pluto_hook_features§cell_id$62a1289b-ce6a-444d-8b20-92bd4fa3d05ddepends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$221fd504-4cd6-4bab-b2a5-a590fff26a52queued¤logsrunning¦outputbodymsg(UndefVarError: `Standardize` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#221fd504-4cd6-4bab-b2a5-a590fff26a52source_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#221fd504-4cd6-4bab-b2a5-a590fff26a52functop-level scopeparent_modulefrom_c«plain_errorٻUndefVarError: `Standardize` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#221fd504-4cd6-4bab-b2a5-a590fff26a52:1mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampA(|Lؾpersist_js_state·has_pluto_hook_features§cell_id$221fd504-4cd6-4bab-b2a5-a590fff26a52depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$a191392f-eb62-459d-8554-901d9db29950queued¤logsrunning¦outputbodymsg-UndefVarError: `transformed_data` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#a191392f-eb62-459d-8554-901d9db29950source_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#a191392f-eb62-459d-8554-901d9db29950functop-level scopeparent_modulefrom_c«plain_errorUndefVarError: `transformed_data` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#a191392f-eb62-459d-8554-901d9db29950:1mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampA(|^ipersist_js_state·has_pluto_hook_features§cell_id$a191392f-eb62-459d-8554-901d9db29950depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$67d7c60c-1c5e-4760-a9e1-4538e2ccc10equeued¤logsrunning¦outputbodyD<div class="markdown"><h4 id="Initializing-the-optimizer">Initializing the optimizer</h4>
<p>Some optimizers require a state. This state is used to save additional information about previous optimization steps, for example in optimizers that use &quot;momentum&quot; terms like <a href="https://en.wikipedia.org/wiki/Stochastic_gradient_descent#Adam">ADAM</a>.</p>
<p>When setting up an Optimizer in Optimisers.jl, <code>init</code> is called on it, which initializes a state. <code>init</code> takes two arguments: an optimizer object and an array of initial parameters.</p>
<pre><code class="language-julia">function Optimisers.init&#40;alg::MyOptimiser, params_init::AbstractArray&#41;
	state &#61; ... # some computation
	return state
end</code></pre>
<p>The state is then updated in the <code>apply&#33;</code> function.</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(ߨHpersist_js_state·has_pluto_hook_features§cell_id$67d7c60c-1c5e-4760-a9e1-4538e2ccc10edepends_on_disabled_cells§runtime Kѵpublished_object_keysdepends_on_skipped_cells§errored$d16b1a65-5da9-46ac-b0b8-59e55ced37f3queued¤logsrunning¦outputbodyd<div class="markdown"><h3 id="Exercise-2.1-–-Constructor">Exercise 2.1 – Constructor</h3>
</div>mimetext/htmlrootassigneelast_run_timestampA(Opersist_js_state·has_pluto_hook_features§cell_id$d16b1a65-5da9-46ac-b0b8-59e55ced37f3depends_on_disabled_cells§runtime ^published_object_keysdepends_on_skipped_cells§errored$7de85c6f-996a-4d5b-8236-271922aeb908queued¤logsrunning¦outputbodymsg(UndefVarError: `Standardize` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#7de85c6f-996a-4d5b-8236-271922aeb908source_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#7de85c6f-996a-4d5b-8236-271922aeb908functop-level scopeparent_modulefrom_c«plain_errorٻUndefVarError: `Standardize` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#7de85c6f-996a-4d5b-8236-271922aeb908:1mime'application/vnd.pluto.stacktrace+objectrootassigneelast_run_timestampA(|b2persist_js_state·has_pluto_hook_features§cell_id$7de85c6f-996a-4d5b-8236-271922aeb908depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$edb7814a-eddf-4c87-8857-19bb0a0c0241queued¤logsrunning¦outputbody<div class="markdown"><h1 id="Feedback">Feedback</h1>
<p>Please help us improve the course by giving us feedback&#33;</p>
<p>You can write whatever you want in the following string. Feel free to add or delete whatever you want.</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(蹪persist_js_state·has_pluto_hook_features§cell_id$edb7814a-eddf-4c87-8857-19bb0a0c0241depends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$2258b8c6-e8b7-4c06-9ece-53b254db6a2cqueued¤logsrunning¦outputbodyK<div class="markdown"><div class="admonition Task"><p class="admonition-title">Task (4 points)</p><p>Create a parametric composite type <code>Standardize</code> with two fields <code>mean</code> and <code>std</code> &#40;for <span class="tex">$\mu$</span> and <span class="tex">$\sigma$</span>&#41; using the type parameter <code>T&lt;:Real</code>.</p>
<p>These two fields will hold the mean and the standard deviation of the standardization transformation.</p>
<p><code>Standardize</code> should have two constructors:</p>
<ol>
<li><p>An inner constructor that takes two numbers <span class="tex">$μ$</span> and <span class="tex">$σ$</span>. Throw an <code>error</code> if <span class="tex">$σ ≤ 0$</span>.</p>
</li>
<li><p>An outer constructor that takes an array <code>data</code>, computes its mean and standard deviation and calls the inner constructor.</p>
</li>
</ol>
<hr />
<p>You are allowed to use the <code>mean</code> and <code>std</code> functions from the standard library package <a href="https://docs.julialang.org/en/v1/stdlib/Statistics/">Statistics.jl</a>.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA({persist_js_state·has_pluto_hook_features§cell_id$2258b8c6-e8b7-4c06-9ece-53b254db6a2cdepends_on_disabled_cells§runtimeՖpublished_object_keysdepends_on_skipped_cells§errored$8e8d9f57-0f04-4a91-b69f-273fe1fafd61queued¤logsrunning¦outputbody+<style>.dont-panic{ display: none }</style>mimetext/htmlrootassigneelast_run_timestampA(Ƥpersist_js_state·has_pluto_hook_features§cell_id$8e8d9f57-0f04-4a91-b69f-273fe1fafd61depends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$f7347c06-c1b7-11ed-3b8e-fbf167ce9cbaqueued¤logsrunning¦outputbody0	<h1 style="text-align:left">
		Julia for Machine Learning
	</h1>
	<div style="text-align:left">
		<p style="font-weight:bold; font-size: 35px; font-variant: small-caps; margin: 0px">
			Homework 3: Custom types
		</p>
		<p style="font-size: 20px;">
			TU Berlin, Summer Semester 2026<br>
		</p>
	</div>
mimetext/htmlrootassigneelast_run_timestampA(epersist_js_state·has_pluto_hook_features§cell_id$f7347c06-c1b7-11ed-3b8e-fbf167ce9cbadepends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$c322fd53-78db-40ae-b7ba-612200ab6617queued¤logsrunning¦outputbodyG<div class="markdown"><h3 id="Interlude:-Gradient-based-optimization-in-Deep-Learning">Interlude: Gradient-based optimization in Deep Learning</h3>
<p>Gradient-based optimization methods are used in deep learning, where we want to optimize a neural network <span class="tex">$f$</span> that is parametrized by parameters <span class="tex">$\theta$</span> &#40;e.g. the weights and biases of <span class="tex">$f$</span>&#41;.</p>
<p>This neural network could e.g. be a classifier that predicts the output class <span class="tex">$\hat&#123;y&#125;$</span> for some input image <span class="tex">$x$</span>:</p>
<p class="tex">$$\hat&#123;y&#125; &#61; f_\theta&#40;x&#41;$$</p>
<p>In <a href="https://en.wikipedia.org/wiki/Supervised_learning">supervised learning</a>, we are also given true labels <span class="tex">$y$</span>. Based on the true and predicted labels, we define a loss</p>
<p class="tex">$$\mathcal&#123;L&#125;_\theta&#40;\hat&#123;y&#125;, y&#41;$$</p>
<p>which depends on <span class="tex">$\theta$</span>, since the parameters of our neural network determine the prediction <span class="tex">$\hat&#123;y&#125;$</span>.</p>
<p>To optimize <span class="tex">$\theta$</span>, we typically compute the gradient of our loss with respect to our parameters and update the parameters using gradient-based optimization methods.</p>
</div>mimetext/htmlrootassigneelast_run_timestampA((tpersist_js_state·has_pluto_hook_features§cell_id$c322fd53-78db-40ae-b7ba-612200ab6617depends_on_disabled_cells§runtime ^published_object_keysdepends_on_skipped_cells§errored$dc4f7f55-dde5-4ee6-b43d-7f64269b55d1queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampA(-persist_js_state·has_pluto_hook_features§cell_id$dc4f7f55-dde5-4ee6-b43d-7f64269b55d1depends_on_disabled_cells§runtime$kpublished_object_keysdepends_on_skipped_cells§errored$cd7c244d-8a4c-4aaf-ad4b-891744e004bequeued¤logsrunning¦outputbody <script src="https://cdn.plot.ly/plotly-2.6.3.min.js"></script>    <div id="id_ab4ae0a4_51e5_43fc_8431_071b88381e89" style="width:600px;height:400px;"></div>
    <script>
    ;(()=> {
    function plots_jl_plotly_id_ab4ae0a4_51e5_43fc_8431_071b88381e89() {
        
        Plotly.newPlot('id_ab4ae0a4_51e5_43fc_8431_071b88381e89', [
    {
        "showlegend": false,
        "xaxis": "x",
        "colorbar": {
            "y": 0.5329861111111112,
            "title": "",
            "len": 0.914342738407699,
            "x": 0.760492308253135
        },
        "name": "y1",
        "colorscale": [
            [
                0.0,
                "rgba(0, 0, 4, 1.000)"
            ],
            [
                0.00392156862745098,
                "rgba(1, 0, 5, 1.000)"
            ],
            [
                0.00784313725490196,
                "rgba(1, 1, 6, 1.000)"
            ],
            [
                0.011764705882352941,
                "rgba(1, 1, 8, 1.000)"
            ],
            [
                0.01568627450980392,
                "rgba(2, 1, 10, 1.000)"
            ],
            [
                0.0196078431372549,
                "rgba(2, 2, 12, 1.000)"
            ],
            [
                0.023529411764705882,
                "rgba(2, 2, 14, 1.000)"
            ],
            [
                0.027450980392156862,
                "rgba(3, 2, 16, 1.000)"
            ],
            [
                0.03137254901960784,
                "rgba(4, 3, 18, 1.000)"
            ],
            [
                0.03529411764705882,
                "rgba(4, 3, 20, 1.000)"
            ],
            [
                0.0392156862745098,
                "rgba(5, 4, 23, 1.000)"
            ],
            [
                0.043137254901960784,
                "rgba(6, 4, 25, 1.000)"
            ],
            [
                0.047058823529411764,
                "rgba(7, 5, 27, 1.000)"
            ],
            [
                0.050980392156862744,
                "rgba(8, 5, 29, 1.000)"
            ],
            [
                0.054901960784313725,
                "rgba(9, 6, 31, 1.000)"
            ],
            [
                0.058823529411764705,
                "rgba(10, 7, 34, 1.000)"
            ],
            [
                0.06274509803921569,
                "rgba(11, 7, 36, 1.000)"
            ],
            [
                0.06666666666666667,
                "rgba(12, 8, 38, 1.000)"
            ],
            [
                0.07058823529411765,
                "rgba(13, 8, 41, 1.000)"
            ],
            [
                0.07450980392156863,
                "rgba(14, 9, 43, 1.000)"
            ],
            [
                0.0784313725490196,
                "rgba(16, 9, 45, 1.000)"
            ],
            [
                0.08235294117647059,
                "rgba(17, 10, 48, 1.000)"
            ],
            [
                0.08627450980392157,
                "rgba(18, 10, 50, 1.000)"
            ],
            [
                0.09019607843137255,
                "rgba(20, 11, 52, 1.000)"
            ],
            [
                0.09411764705882353,
                "rgba(21, 11, 55, 1.000)"
            ],
            [
                0.09803921568627451,
                "rgba(22, 11, 57, 1.000)"
            ],
            [
                0.10196078431372549,
                "rgba(24, 12, 60, 1.000)"
            ],
            [
                0.10588235294117647,
                "rgba(25, 12, 62, 1.000)"
            ],
            [
                0.10980392156862745,
                "rgba(27, 12, 65, 1.000)"
            ],
            [
                0.11372549019607843,
                "rgba(28, 12, 67, 1.000)"
            ],
            [
                0.11764705882352941,
                "rgba(30, 12, 69, 1.000)"
            ],
            [
                0.12156862745098039,
                "rgba(31, 12, 72, 1.000)"
            ],
            [
                0.12549019607843137,
                "rgba(33, 12, 74, 1.000)"
            ],
            [
                0.12941176470588237,
                "rgba(35, 12, 76, 1.000)"
            ],
            [
                0.13333333333333333,
                "rgba(36, 12, 79, 1.000)"
            ],
            [
                0.13725490196078433,
                "rgba(38, 12, 81, 1.000)"
            ],
            [
                0.1411764705882353,
                "rgba(40, 11, 83, 1.000)"
            ],
            [
                0.1450980392156863,
                "rgba(41, 11, 85, 1.000)"
            ],
            [
                0.14901960784313725,
                "rgba(43, 11, 87, 1.000)"
            ],
            [
                0.15294117647058825,
                "rgba(45, 11, 89, 1.000)"
            ],
            [
                0.1568627450980392,
                "rgba(47, 10, 91, 1.000)"
            ],
            [
                0.1607843137254902,
                "rgba(49, 10, 92, 1.000)"
            ],
            [
                0.16470588235294117,
                "rgba(50, 10, 94, 1.000)"
            ],
            [
                0.16862745098039217,
                "rgba(52, 10, 95, 1.000)"
            ],
            [
                0.17254901960784313,
                "rgba(54, 9, 97, 1.000)"
            ],
            [
                0.17647058823529413,
                "rgba(56, 9, 98, 1.000)"
            ],
            [
                0.1803921568627451,
                "rgba(57, 9, 99, 1.000)"
            ],
            [
                0.1843137254901961,
                "rgba(59, 9, 100, 1.000)"
            ],
            [
                0.18823529411764706,
                "rgba(61, 9, 101, 1.000)"
            ],
            [
                0.19215686274509805,
                "rgba(62, 9, 102, 1.000)"
            ],
            [
                0.19607843137254902,
                "rgba(64, 10, 103, 1.000)"
            ],
            [
                0.2,
                "rgba(66, 10, 104, 1.000)"
            ],
            [
                0.20392156862745098,
                "rgba(68, 10, 104, 1.000)"
            ],
            [
                0.20784313725490197,
                "rgba(69, 10, 105, 1.000)"
            ],
            [
                0.21176470588235294,
                "rgba(71, 11, 106, 1.000)"
            ],
            [
                0.21568627450980393,
                "rgba(73, 11, 106, 1.000)"
            ],
            [
                0.2196078431372549,
                "rgba(74, 12, 107, 1.000)"
            ],
            [
                0.2235294117647059,
                "rgba(76, 12, 107, 1.000)"
            ],
            [
                0.22745098039215686,
                "rgba(77, 13, 108, 1.000)"
            ],
            [
                0.23137254901960785,
                "rgba(79, 13, 108, 1.000)"
            ],
            [
                0.23529411764705882,
                "rgba(81, 14, 108, 1.000)"
            ],
            [
                0.23921568627450981,
                "rgba(82, 14, 109, 1.000)"
            ],
            [
                0.24313725490196078,
                "rgba(84, 15, 109, 1.000)"
            ],
            [
                0.24705882352941178,
                "rgba(85, 15, 109, 1.000)"
            ],
            [
                0.25098039215686274,
                "rgba(87, 16, 110, 1.000)"
            ],
            [
                0.2549019607843137,
                "rgba(89, 16, 110, 1.000)"
            ],
            [
                0.25882352941176473,
                "rgba(90, 17, 110, 1.000)"
            ],
            [
                0.2627450980392157,
                "rgba(92, 18, 110, 1.000)"
            ],
            [
                0.26666666666666666,
                "rgba(93, 18, 110, 1.000)"
            ],
            [
                0.27058823529411763,
                "rgba(95, 19, 110, 1.000)"
            ],
            [
                0.27450980392156865,
                "rgba(97, 19, 110, 1.000)"
            ],
            [
                0.2784313725490196,
                "rgba(98, 20, 110, 1.000)"
            ],
            [
                0.2823529411764706,
                "rgba(100, 21, 110, 1.000)"
            ],
            [
                0.28627450980392155,
                "rgba(101, 21, 110, 1.000)"
            ],
            [
                0.2901960784313726,
                "rgba(103, 22, 110, 1.000)"
            ],
            [
                0.29411764705882354,
                "rgba(105, 22, 110, 1.000)"
            ],
            [
                0.2980392156862745,
                "rgba(106, 23, 110, 1.000)"
            ],
            [
                0.30196078431372547,
                "rgba(108, 24, 110, 1.000)"
            ],
            [
                0.3058823529411765,
                "rgba(109, 24, 110, 1.000)"
            ],
            [
                0.30980392156862746,
                "rgba(111, 25, 110, 1.000)"
            ],
            [
                0.3137254901960784,
                "rgba(113, 25, 110, 1.000)"
            ],
            [
                0.3176470588235294,
                "rgba(114, 26, 110, 1.000)"
            ],
            [
                0.3215686274509804,
                "rgba(116, 26, 110, 1.000)"
            ],
            [
                0.3254901960784314,
                "rgba(117, 27, 110, 1.000)"
            ],
            [
                0.32941176470588235,
                "rgba(119, 28, 109, 1.000)"
            ],
            [
                0.3333333333333333,
                "rgba(120, 28, 109, 1.000)"
            ],
            [
                0.33725490196078434,
                "rgba(122, 29, 109, 1.000)"
            ],
            [
                0.3411764705882353,
                "rgba(124, 29, 109, 1.000)"
            ],
            [
                0.34509803921568627,
                "rgba(125, 30, 109, 1.000)"
            ],
            [
                0.34901960784313724,
                "rgba(127, 30, 108, 1.000)"
            ],
            [
                0.35294117647058826,
                "rgba(128, 31, 108, 1.000)"
            ],
            [
                0.3568627450980392,
                "rgba(130, 32, 108, 1.000)"
            ],
            [
                0.3607843137254902,
                "rgba(132, 32, 107, 1.000)"
            ],
            [
                0.36470588235294116,
                "rgba(133, 33, 107, 1.000)"
            ],
            [
                0.3686274509803922,
                "rgba(135, 33, 107, 1.000)"
            ],
            [
                0.37254901960784315,
                "rgba(136, 34, 106, 1.000)"
            ],
            [
                0.3764705882352941,
                "rgba(138, 34, 106, 1.000)"
            ],
            [
                0.3803921568627451,
                "rgba(140, 35, 105, 1.000)"
            ],
            [
                0.3843137254901961,
                "rgba(141, 35, 105, 1.000)"
            ],
            [
                0.38823529411764707,
                "rgba(143, 36, 105, 1.000)"
            ],
            [
                0.39215686274509803,
                "rgba(144, 37, 104, 1.000)"
            ],
            [
                0.396078431372549,
                "rgba(146, 37, 104, 1.000)"
            ],
            [
                0.4,
                "rgba(147, 38, 103, 1.000)"
            ],
            [
                0.403921568627451,
                "rgba(149, 38, 103, 1.000)"
            ],
            [
                0.40784313725490196,
                "rgba(151, 39, 102, 1.000)"
            ],
            [
                0.4117647058823529,
                "rgba(152, 39, 102, 1.000)"
            ],
            [
                0.41568627450980394,
                "rgba(154, 40, 101, 1.000)"
            ],
            [
                0.4196078431372549,
                "rgba(155, 41, 100, 1.000)"
            ],
            [
                0.4235294117647059,
                "rgba(157, 41, 100, 1.000)"
            ],
            [
                0.42745098039215684,
                "rgba(159, 42, 99, 1.000)"
            ],
            [
                0.43137254901960786,
                "rgba(160, 42, 99, 1.000)"
            ],
            [
                0.43529411764705883,
                "rgba(162, 43, 98, 1.000)"
            ],
            [
                0.4392156862745098,
                "rgba(163, 44, 97, 1.000)"
            ],
            [
                0.44313725490196076,
                "rgba(165, 44, 96, 1.000)"
            ],
            [
                0.4470588235294118,
                "rgba(166, 45, 96, 1.000)"
            ],
            [
                0.45098039215686275,
                "rgba(168, 46, 95, 1.000)"
            ],
            [
                0.4549019607843137,
                "rgba(169, 46, 94, 1.000)"
            ],
            [
                0.4588235294117647,
                "rgba(171, 47, 94, 1.000)"
            ],
            [
                0.4627450980392157,
                "rgba(173, 48, 93, 1.000)"
            ],
            [
                0.4666666666666667,
                "rgba(174, 48, 92, 1.000)"
            ],
            [
                0.47058823529411764,
                "rgba(176, 49, 91, 1.000)"
            ],
            [
                0.4745098039215686,
                "rgba(177, 50, 90, 1.000)"
            ],
            [
                0.47843137254901963,
                "rgba(179, 50, 90, 1.000)"
            ],
            [
                0.4823529411764706,
                "rgba(180, 51, 89, 1.000)"
            ],
            [
                0.48627450980392156,
                "rgba(182, 52, 88, 1.000)"
            ],
            [
                0.49019607843137253,
                "rgba(183, 53, 87, 1.000)"
            ],
            [
                0.49411764705882355,
                "rgba(185, 53, 86, 1.000)"
            ],
            [
                0.4980392156862745,
                "rgba(186, 54, 85, 1.000)"
            ],
            [
                0.5019607843137255,
                "rgba(188, 55, 84, 1.000)"
            ],
            [
                0.5058823529411764,
                "rgba(189, 56, 83, 1.000)"
            ],
            [
                0.5098039215686274,
                "rgba(191, 57, 82, 1.000)"
            ],
            [
                0.5137254901960784,
                "rgba(192, 58, 81, 1.000)"
            ],
            [
                0.5176470588235295,
                "rgba(193, 58, 80, 1.000)"
            ],
            [
                0.5215686274509804,
                "rgba(195, 59, 79, 1.000)"
            ],
            [
                0.5254901960784314,
                "rgba(196, 60, 78, 1.000)"
            ],
            [
                0.5294117647058824,
                "rgba(198, 61, 77, 1.000)"
            ],
            [
                0.5333333333333333,
                "rgba(199, 62, 76, 1.000)"
            ],
            [
                0.5372549019607843,
                "rgba(200, 63, 75, 1.000)"
            ],
            [
                0.5411764705882353,
                "rgba(202, 64, 74, 1.000)"
            ],
            [
                0.5450980392156862,
                "rgba(203, 65, 73, 1.000)"
            ],
            [
                0.5490196078431373,
                "rgba(204, 66, 72, 1.000)"
            ],
            [
                0.5529411764705883,
                "rgba(206, 67, 71, 1.000)"
            ],
            [
                0.5568627450980392,
                "rgba(207, 68, 70, 1.000)"
            ],
            [
                0.5607843137254902,
                "rgba(208, 69, 69, 1.000)"
            ],
            [
                0.5647058823529412,
                "rgba(210, 70, 68, 1.000)"
            ],
            [
                0.5686274509803921,
                "rgba(211, 71, 67, 1.000)"
            ],
            [
                0.5725490196078431,
                "rgba(212, 72, 66, 1.000)"
            ],
            [
                0.5764705882352941,
                "rgba(213, 74, 65, 1.000)"
            ],
            [
                0.5803921568627451,
                "rgba(215, 75, 63, 1.000)"
            ],
            [
                0.5843137254901961,
                "rgba(216, 76, 62, 1.000)"
            ],
            [
                0.5882352941176471,
                "rgba(217, 77, 61, 1.000)"
            ],
            [
                0.592156862745098,
                "rgba(218, 78, 60, 1.000)"
            ],
            [
                0.596078431372549,
                "rgba(219, 80, 59, 1.000)"
            ],
            [
                0.6,
                "rgba(221, 81, 58, 1.000)"
            ],
            [
                0.6039215686274509,
                "rgba(222, 82, 56, 1.000)"
            ],
            [
                0.6078431372549019,
                "rgba(223, 83, 55, 1.000)"
            ],
            [
                0.611764705882353,
                "rgba(224, 85, 54, 1.000)"
            ],
            [
                0.615686274509804,
                "rgba(225, 86, 53, 1.000)"
            ],
            [
                0.6196078431372549,
                "rgba(226, 87, 52, 1.000)"
            ],
            [
                0.6235294117647059,
                "rgba(227, 89, 51, 1.000)"
            ],
            [
                0.6274509803921569,
                "rgba(228, 90, 49, 1.000)"
            ],
            [
                0.6313725490196078,
                "rgba(229, 92, 48, 1.000)"
            ],
            [
                0.6352941176470588,
                "rgba(230, 93, 47, 1.000)"
            ],
            [
                0.6392156862745098,
                "rgba(231, 94, 46, 1.000)"
            ],
            [
                0.6431372549019608,
                "rgba(232, 96, 45, 1.000)"
            ],
            [
                0.6470588235294118,
                "rgba(233, 97, 43, 1.000)"
            ],
            [
                0.6509803921568628,
                "rgba(234, 99, 42, 1.000)"
            ],
            [
                0.6549019607843137,
                "rgba(235, 100, 41, 1.000)"
            ],
            [
                0.6588235294117647,
                "rgba(235, 102, 40, 1.000)"
            ],
            [
                0.6627450980392157,
                "rgba(236, 103, 38, 1.000)"
            ],
            [
                0.6666666666666666,
                "rgba(237, 105, 37, 1.000)"
            ],
            [
                0.6705882352941176,
                "rgba(238, 106, 36, 1.000)"
            ],
            [
                0.6745098039215687,
                "rgba(239, 108, 35, 1.000)"
            ],
            [
                0.6784313725490196,
                "rgba(239, 110, 33, 1.000)"
            ],
            [
                0.6823529411764706,
                "rgba(240, 111, 32, 1.000)"
            ],
            [
                0.6862745098039216,
                "rgba(241, 113, 31, 1.000)"
            ],
            [
                0.6901960784313725,
                "rgba(241, 115, 29, 1.000)"
            ],
            [
                0.6941176470588235,
                "rgba(242, 116, 28, 1.000)"
            ],
            [
                0.6980392156862745,
                "rgba(243, 118, 27, 1.000)"
            ],
            [
                0.7019607843137254,
                "rgba(243, 120, 25, 1.000)"
            ],
            [
                0.7058823529411765,
                "rgba(244, 121, 24, 1.000)"
            ],
            [
                0.7098039215686275,
                "rgba(245, 123, 23, 1.000)"
            ],
            [
                0.7137254901960784,
                "rgba(245, 125, 21, 1.000)"
            ],
            [
                0.7176470588235294,
                "rgba(246, 126, 20, 1.000)"
            ],
            [
                0.7215686274509804,
                "rgba(246, 128, 19, 1.000)"
            ],
            [
                0.7254901960784313,
                "rgba(247, 130, 18, 1.000)"
            ],
            [
                0.7294117647058823,
                "rgba(247, 132, 16, 1.000)"
            ],
            [
                0.7333333333333333,
                "rgba(248, 133, 15, 1.000)"
            ],
            [
                0.7372549019607844,
                "rgba(248, 135, 14, 1.000)"
            ],
            [
                0.7411764705882353,
                "rgba(248, 137, 12, 1.000)"
            ],
            [
                0.7450980392156863,
                "rgba(249, 139, 11, 1.000)"
            ],
            [
                0.7490196078431373,
                "rgba(249, 140, 10, 1.000)"
            ],
            [
                0.7529411764705882,
                "rgba(249, 142, 9, 1.000)"
            ],
            [
                0.7568627450980392,
                "rgba(250, 144, 8, 1.000)"
            ],
            [
                0.7607843137254902,
                "rgba(250, 146, 7, 1.000)"
            ],
            [
                0.7647058823529411,
                "rgba(250, 148, 7, 1.000)"
            ],
            [
                0.7686274509803922,
                "rgba(251, 150, 6, 1.000)"
            ],
            [
                0.7725490196078432,
                "rgba(251, 151, 6, 1.000)"
            ],
            [
                0.7764705882352941,
                "rgba(251, 153, 6, 1.000)"
            ],
            [
                0.7803921568627451,
                "rgba(251, 155, 6, 1.000)"
            ],
            [
                0.7843137254901961,
                "rgba(251, 157, 7, 1.000)"
            ],
            [
                0.788235294117647,
                "rgba(252, 159, 7, 1.000)"
            ],
            [
                0.792156862745098,
                "rgba(252, 161, 8, 1.000)"
            ],
            [
                0.796078431372549,
                "rgba(252, 163, 9, 1.000)"
            ],
            [
                0.8,
                "rgba(252, 165, 10, 1.000)"
            ],
            [
                0.803921568627451,
                "rgba(252, 166, 12, 1.000)"
            ],
            [
                0.807843137254902,
                "rgba(252, 168, 13, 1.000)"
            ],
            [
                0.8117647058823529,
                "rgba(252, 170, 15, 1.000)"
            ],
            [
                0.8156862745098039,
                "rgba(252, 172, 17, 1.000)"
            ],
            [
                0.8196078431372549,
                "rgba(252, 174, 18, 1.000)"
            ],
            [
                0.8235294117647058,
                "rgba(252, 176, 20, 1.000)"
            ],
            [
                0.8274509803921568,
                "rgba(252, 178, 22, 1.000)"
            ],
            [
                0.8313725490196079,
                "rgba(252, 180, 24, 1.000)"
            ],
            [
                0.8352941176470589,
                "rgba(251, 182, 26, 1.000)"
            ],
            [
                0.8392156862745098,
                "rgba(251, 184, 29, 1.000)"
            ],
            [
                0.8431372549019608,
                "rgba(251, 186, 31, 1.000)"
            ],
            [
                0.8470588235294118,
                "rgba(251, 188, 33, 1.000)"
            ],
            [
                0.8509803921568627,
                "rgba(251, 190, 35, 1.000)"
            ],
            [
                0.8549019607843137,
                "rgba(250, 192, 38, 1.000)"
            ],
            [
                0.8588235294117647,
                "rgba(250, 194, 40, 1.000)"
            ],
            [
                0.8627450980392157,
                "rgba(250, 196, 42, 1.000)"
            ],
            [
                0.8666666666666667,
                "rgba(250, 198, 45, 1.000)"
            ],
            [
                0.8705882352941177,
                "rgba(249, 199, 47, 1.000)"
            ],
            [
                0.8745098039215686,
                "rgba(249, 201, 50, 1.000)"
            ],
            [
                0.8784313725490196,
                "rgba(249, 203, 53, 1.000)"
            ],
            [
                0.8823529411764706,
                "rgba(248, 205, 55, 1.000)"
            ],
            [
                0.8862745098039215,
                "rgba(248, 207, 58, 1.000)"
            ],
            [
                0.8901960784313725,
                "rgba(247, 209, 61, 1.000)"
            ],
            [
                0.8941176470588236,
                "rgba(247, 211, 64, 1.000)"
            ],
            [
                0.8980392156862745,
                "rgba(246, 213, 67, 1.000)"
            ],
            [
                0.9019607843137255,
                "rgba(246, 215, 70, 1.000)"
            ],
            [
                0.9058823529411765,
                "rgba(245, 217, 73, 1.000)"
            ],
            [
                0.9098039215686274,
                "rgba(245, 219, 76, 1.000)"
            ],
            [
                0.9137254901960784,
                "rgba(244, 221, 79, 1.000)"
            ],
            [
                0.9176470588235294,
                "rgba(244, 223, 83, 1.000)"
            ],
            [
                0.9215686274509803,
                "rgba(244, 225, 86, 1.000)"
            ],
            [
                0.9254901960784314,
                "rgba(243, 227, 90, 1.000)"
            ],
            [
                0.9294117647058824,
                "rgba(243, 229, 93, 1.000)"
            ],
            [
                0.9333333333333333,
                "rgba(242, 230, 97, 1.000)"
            ],
            [
                0.9372549019607843,
                "rgba(242, 232, 101, 1.000)"
            ],
            [
                0.9411764705882353,
                "rgba(242, 234, 105, 1.000)"
            ],
            [
                0.9450980392156862,
                "rgba(241, 236, 109, 1.000)"
            ],
            [
                0.9490196078431372,
                "rgba(241, 237, 113, 1.000)"
            ],
            [
                0.9529411764705882,
                "rgba(241, 239, 117, 1.000)"
            ],
            [
                0.9568627450980393,
                "rgba(241, 241, 121, 1.000)"
            ],
            [
                0.9607843137254902,
                "rgba(242, 242, 125, 1.000)"
            ],
            [
                0.9647058823529412,
                "rgba(242, 244, 130, 1.000)"
            ],
            [
                0.9686274509803922,
                "rgba(243, 245, 134, 1.000)"
            ],
            [
                0.9725490196078431,
                "rgba(243, 246, 138, 1.000)"
            ],
            [
                0.9764705882352941,
                "rgba(244, 248, 142, 1.000)"
            ],
            [
                0.9803921568627451,
                "rgba(245, 249, 146, 1.000)"
            ],
            [
                0.984313725490196,
                "rgba(246, 250, 150, 1.000)"
            ],
            [
                0.9882352941176471,
                "rgba(248, 251, 154, 1.000)"
            ],
            [
                0.9921568627450981,
                "rgba(249, 252, 157, 1.000)"
            ],
            [
                0.996078431372549,
                "rgba(250, 253, 161, 1.000)"
            ],
            [
                1.0,
                "rgba(252, 255, 164, 1.000)"
            ]
        ],
        "yaxis": "y",
        "zmin": -0.11839999999999999,
        "z": [
            [
                14.0,
                13.619200000000001,
                13.276800000000001,
                12.972800000000001,
                12.7072,
                12.48,
                12.2912,
                12.1408,
                12.028799999999999,
                11.955199999999998,
                11.919999999999998,
                11.923200000000001,
                11.9648,
                12.044799999999999,
                12.163200000000002,
                12.320000000000004,
                12.515200000000002,
                12.7488,
                13.0208,
                13.3312,
                13.680000000000001,
                14.067200000000001,
                14.492799999999999,
                14.9568,
                15.4592,
                16.0,
                16.5792,
                17.196800000000003,
                17.852800000000006,
                18.5472,
                19.280000000000005,
                20.0512,
                20.860800000000005,
                21.708799999999997,
                22.5952,
                23.52,
                24.4832,
                25.4848,
                26.524800000000003,
                27.6032,
                28.720000000000002,
                29.875200000000003,
                31.068800000000003,
                32.300799999999995,
                33.57119999999999,
                34.879999999999995,
                36.227199999999996,
                37.6128,
                39.03679999999999,
                40.499199999999995,
                42.0
            ],
            [
                13.3856,
                12.9792,
                12.6112,
                12.2816,
                11.9904,
                11.737599999999999,
                11.5232,
                11.347199999999999,
                11.209599999999998,
                11.110399999999997,
                11.049599999999998,
                11.0272,
                11.043199999999999,
                11.0976,
                11.1904,
                11.3216,
                11.491200000000001,
                11.6992,
                11.945599999999999,
                12.2304,
                12.5536,
                12.9152,
                13.315199999999997,
                13.753599999999997,
                14.2304,
                14.7456,
                15.299199999999999,
                15.891200000000001,
                16.521600000000003,
                17.1904,
                17.897600000000004,
                18.6432,
                19.427200000000003,
                20.249599999999994,
                21.1104,
                22.0096,
                22.9472,
                23.923199999999998,
                24.9376,
                25.9904,
                27.0816,
                28.2112,
                29.379200000000004,
                30.58559999999999,
                31.830399999999994,
                33.1136,
                34.435199999999995,
                35.7952,
                37.193599999999996,
                38.630399999999995,
                40.105599999999995
            ],
            [
                12.8224,
                12.390400000000001,
                11.9968,
                11.6416,
                11.3248,
                11.0464,
                10.8064,
                10.6048,
                10.441600000000001,
                10.3168,
                10.230400000000001,
                10.182400000000001,
                10.172800000000002,
                10.201600000000003,
                10.268800000000002,
                10.374400000000001,
                10.5184,
                10.700800000000001,
                10.921600000000002,
                11.180800000000003,
                11.478400000000002,
                11.814400000000003,
                12.188800000000002,
                12.6016,
                13.052800000000001,
                13.5424,
                14.070400000000003,
                14.636800000000003,
                15.241599999999998,
                15.884799999999998,
                16.5664,
                17.2864,
                18.044800000000002,
                18.8416,
                19.676800000000004,
                20.550400000000003,
                21.462400000000006,
                22.412800000000004,
                23.401600000000006,
                24.428800000000006,
                25.4944,
                26.5984,
                27.740800000000004,
                28.9216,
                30.140800000000002,
                31.398400000000002,
                32.6944,
                34.02880000000001,
                35.4016,
                36.812799999999996,
                38.2624
            ],
            [
                12.3104,
                11.8528,
                11.4336,
                11.0528,
                10.7104,
                10.4064,
                10.140799999999999,
                9.9136,
                9.7248,
                9.5744,
                9.4624,
                9.3888,
                9.3536,
                9.3568,
                9.3984,
                9.4784,
                9.5968,
                9.7536,
                9.9488,
                10.182400000000001,
                10.454400000000001,
                10.764800000000003,
                11.113600000000002,
                11.500799999999998,
                11.9264,
                12.3904,
                12.892800000000001,
                13.4336,
                14.012799999999999,
                14.6304,
                15.286399999999999,
                15.980799999999999,
                16.7136,
                17.4848,
                18.294400000000003,
                19.142400000000002,
                20.028800000000004,
                20.9536,
                21.916800000000006,
                22.918400000000005,
                23.958399999999997,
                25.0368,
                26.1536,
                27.3088,
                28.5024,
                29.7344,
                31.004800000000003,
                32.3136,
                33.6608,
                35.04639999999999,
                36.4704
            ],
            [
                11.849599999999999,
                11.3664,
                10.9216,
                10.515199999999998,
                10.147199999999998,
                9.8176,
                9.526399999999999,
                9.2736,
                9.059199999999999,
                8.8832,
                8.7456,
                8.6464,
                8.5856,
                8.563199999999998,
                8.5792,
                8.633599999999998,
                8.726399999999998,
                8.8576,
                9.027199999999999,
                9.2352,
                9.4816,
                9.7664,
                10.0896,
                10.451199999999998,
                10.851199999999999,
                11.289599999999998,
                11.766399999999999,
                12.2816,
                12.835199999999997,
                13.427199999999997,
                14.057599999999999,
                14.7264,
                15.433599999999998,
                16.179199999999998,
                16.9632,
                17.785600000000002,
                18.646400000000003,
                19.5456,
                20.483200000000004,
                21.459200000000003,
                22.473599999999998,
                23.5264,
                24.6176,
                25.747199999999996,
                26.9152,
                28.1216,
                29.366400000000002,
                30.649599999999996,
                31.9712,
                33.33119999999999,
                34.72959999999999
            ],
            [
                11.440000000000001,
                10.9312,
                10.4608,
                10.0288,
                9.6352,
                9.280000000000001,
                8.9632,
                8.684800000000001,
                8.4448,
                8.2432,
                8.08,
                7.9552000000000005,
                7.868800000000001,
                7.820800000000001,
                7.811200000000001,
                7.840000000000002,
                7.907200000000002,
                8.0128,
                8.1568,
                8.339200000000002,
                8.560000000000002,
                8.819200000000002,
                9.1168,
                9.4528,
                9.827200000000001,
                10.240000000000002,
                10.691200000000002,
                11.180800000000001,
                11.708800000000002,
                12.2752,
                12.88,
                13.523200000000001,
                14.204800000000002,
                14.924800000000003,
                15.683199999999998,
                16.48,
                17.3152,
                18.1888,
                19.100800000000003,
                20.0512,
                21.040000000000003,
                22.067200000000003,
                23.132800000000007,
                24.236800000000006,
                25.379200000000004,
                26.560000000000006,
                27.7792,
                29.0368,
                30.332800000000002,
                31.6672,
                33.040000000000006
            ],
            [
                11.0816,
                10.5472,
                10.0512,
                9.5936,
                9.1744,
                8.793600000000001,
                8.4512,
                8.1472,
                7.881600000000001,
                7.6544,
                7.4656,
                7.3152,
                7.2032,
                7.129600000000001,
                7.0944,
                7.097600000000001,
                7.1392000000000015,
                7.2192,
                7.3376,
                7.494400000000001,
                7.689600000000001,
                7.923200000000001,
                8.195199999999998,
                8.5056,
                8.8544,
                9.2416,
                9.667200000000001,
                10.131200000000002,
                10.633600000000001,
                11.174399999999999,
                11.753599999999999,
                12.3712,
                13.0272,
                13.7216,
                14.454399999999998,
                15.2256,
                16.0352,
                16.8832,
                17.7696,
                18.6944,
                19.657600000000002,
                20.659200000000002,
                21.699200000000005,
                22.777600000000003,
                23.894400000000005,
                25.049600000000005,
                26.243199999999998,
                27.475199999999997,
                28.7456,
                30.0544,
                31.401600000000002
            ],
            [
                10.7744,
                10.2144,
                9.6928,
                9.2096,
                8.7648,
                8.3584,
                7.990399999999999,
                7.6608,
                7.369600000000001,
                7.1168000000000005,
                6.902399999999999,
                6.7264,
                6.5888,
                6.4896,
                6.4288,
                6.4064000000000005,
                6.4224000000000006,
                6.476799999999999,
                6.569599999999999,
                6.700799999999999,
                6.870400000000001,
                7.0784,
                7.324799999999998,
                7.609599999999999,
                7.932799999999999,
                8.2944,
                8.6944,
                9.1328,
                9.6096,
                10.124799999999999,
                10.678399999999998,
                11.270399999999999,
                11.900799999999998,
                12.5696,
                13.276799999999996,
                14.022399999999998,
                14.806399999999998,
                15.628799999999998,
                16.4896,
                17.3888,
                18.3264,
                19.302400000000002,
                20.316800000000004,
                21.369600000000002,
                22.460800000000003,
                23.590400000000002,
                24.758399999999998,
                25.964799999999997,
                27.2096,
                28.492799999999995,
                29.8144
            ],
            [
                10.5184,
                9.9328,
                9.3856,
                8.876800000000001,
                8.4064,
                7.974400000000001,
                7.5808,
                7.2256,
                6.908800000000001,
                6.630400000000001,
                6.3904000000000005,
                6.188800000000001,
                6.025600000000001,
                5.900800000000001,
                5.814400000000001,
                5.766400000000001,
                5.756799999999999,
                5.7856000000000005,
                5.8528,
                5.958400000000001,
                6.102400000000002,
                6.2848000000000015,
                6.505600000000002,
                6.7648,
                7.062400000000001,
                7.398400000000001,
                7.772800000000002,
                8.1856,
                8.6368,
                9.1264,
                9.6544,
                10.220800000000002,
                10.825600000000001,
                11.468800000000002,
                12.150400000000001,
                12.870400000000004,
                13.6288,
                14.4256,
                15.260800000000003,
                16.134400000000003,
                17.0464,
                17.9968,
                18.9856,
                20.012800000000002,
                21.078400000000002,
                22.1824,
                23.324800000000003,
                24.5056,
                25.724800000000005,
                26.982400000000005,
                28.278400000000005
            ],
            [
                10.3136,
                9.7024,
                9.1296,
                8.5952,
                8.0992,
                7.6416,
                7.2224,
                6.8416,
                6.499200000000001,
                6.195200000000001,
                5.929600000000001,
                5.7024,
                5.5136,
                5.3632,
                5.2512,
                5.1776,
                5.142399999999999,
                5.1456,
                5.187200000000001,
                5.267200000000001,
                5.385600000000001,
                5.542400000000001,
                5.737600000000001,
                5.9712,
                6.243200000000001,
                6.5536,
                6.902400000000001,
                7.289600000000001,
                7.7151999999999985,
                8.1792,
                8.6816,
                9.2224,
                9.8016,
                10.419200000000002,
                11.0752,
                11.7696,
                12.502399999999998,
                13.273599999999998,
                14.083200000000001,
                14.9312,
                15.817599999999999,
                16.7424,
                17.7056,
                18.707199999999997,
                19.7472,
                20.8256,
                21.942400000000003,
                23.0976,
                24.291200000000003,
                25.523200000000003,
                26.793600000000005
            ],
            [
                10.16,
                9.5232,
                8.924800000000001,
                8.3648,
                7.843199999999999,
                7.360000000000001,
                6.9152000000000005,
                6.508799999999999,
                6.1408000000000005,
                5.8112,
                5.5200000000000005,
                5.2672,
                5.0528,
                4.876799999999999,
                4.7392,
                4.64,
                4.579199999999999,
                4.556799999999999,
                4.572799999999999,
                4.6272,
                4.720000000000001,
                4.8512,
                5.0208,
                5.228799999999999,
                5.4752,
                5.76,
                6.083200000000001,
                6.4448,
                6.8447999999999976,
                7.283199999999998,
                7.759999999999998,
                8.2752,
                8.8288,
                9.4208,
                10.0512,
                10.720000000000002,
                11.427199999999997,
                12.172799999999999,
                12.956799999999998,
                13.7792,
                14.639999999999997,
                15.5392,
                16.4768,
                17.4528,
                18.4672,
                19.52,
                20.6112,
                21.7408,
                22.908800000000003,
                24.1152,
                25.360000000000003
            ],
            [
                10.0576,
                9.395199999999999,
                8.7712,
                8.1856,
                7.638399999999999,
                7.129600000000002,
                6.6592,
                6.2272,
                5.8336000000000015,
                5.478400000000001,
                5.161600000000001,
                4.8832,
                4.6432,
                4.441600000000001,
                4.2784,
                4.153600000000001,
                4.067200000000001,
                4.0192000000000005,
                4.009600000000001,
                4.038400000000001,
                4.105600000000002,
                4.211200000000001,
                4.3552,
                4.5376,
                4.758400000000001,
                5.017600000000001,
                5.315200000000002,
                5.651200000000001,
                6.025600000000002,
                6.4384,
                6.889600000000001,
                7.379200000000001,
                7.907200000000001,
                8.473600000000001,
                9.078399999999998,
                9.721599999999999,
                10.4032,
                11.1232,
                11.881600000000002,
                12.678400000000003,
                13.513600000000004,
                14.387200000000004,
                15.299200000000006,
                16.249599999999997,
                17.238400000000002,
                18.265600000000003,
                19.3312,
                20.4352,
                21.5776,
                22.7584,
                23.977600000000002
            ],
            [
                10.0064,
                9.3184,
                8.668800000000001,
                8.0576,
                7.484799999999999,
                6.950400000000002,
                6.4544,
                5.9968,
                5.577600000000001,
                5.1968000000000005,
                4.8544,
                4.550400000000001,
                4.284800000000001,
                4.0576,
                3.8688000000000002,
                3.7184,
                3.6064,
                3.5328,
                3.4976000000000003,
                3.5008000000000004,
                3.5424,
                3.6224,
                3.7408,
                3.897600000000001,
                4.0928,
                4.3264000000000005,
                4.598400000000001,
                4.9088,
                5.257600000000001,
                5.644799999999999,
                6.0704,
                6.5344,
                7.036800000000001,
                7.577600000000001,
                8.156799999999999,
                8.7744,
                9.430399999999999,
                10.1248,
                10.857600000000001,
                11.628800000000002,
                12.438400000000001,
                13.286400000000002,
                14.172800000000004,
                15.097599999999998,
                16.0608,
                17.0624,
                18.1024,
                19.180799999999998,
                20.2976,
                21.452799999999996,
                22.6464
            ],
            [
                10.0064,
                9.2928,
                8.617600000000001,
                7.9807999999999995,
                7.382399999999999,
                6.822400000000002,
                6.300800000000001,
                5.8176000000000005,
                5.372800000000001,
                4.9664,
                4.5984,
                4.268800000000001,
                3.9776000000000002,
                3.7248,
                3.5103999999999997,
                3.3343999999999996,
                3.1967999999999996,
                3.0975999999999995,
                3.0368,
                3.0143999999999997,
                3.0303999999999998,
                3.0847999999999995,
                3.1776,
                3.3088,
                3.4783999999999993,
                3.6864,
                3.9328000000000003,
                4.2176,
                4.5408,
                4.902399999999998,
                5.3024,
                5.7408,
                6.217600000000001,
                6.732800000000001,
                7.286399999999998,
                7.8784,
                8.508799999999999,
                9.177599999999998,
                9.884799999999998,
                10.630400000000002,
                11.4144,
                12.236800000000002,
                13.097600000000003,
                13.996799999999999,
                14.9344,
                15.910400000000001,
                16.924799999999998,
                17.977599999999995,
                19.0688,
                20.1984,
                21.3664
            ],
            [
                10.0576,
                9.3184,
                8.617600000000001,
                7.9552,
                7.331199999999999,
                6.745600000000001,
                6.1983999999999995,
                5.6896,
                5.219200000000001,
                4.7872,
                4.3936,
                4.0384,
                3.7216000000000005,
                3.4432,
                3.2032,
                3.0016,
                2.8384,
                2.7136000000000005,
                2.6272,
                2.5792,
                2.5696,
                2.5984,
                2.6656000000000004,
                2.7712000000000008,
                2.9151999999999996,
                3.0976,
                3.3184,
                3.5776,
                3.8751999999999995,
                4.2112,
                4.5856,
                4.9984,
                5.449600000000002,
                5.9392000000000005,
                6.467200000000001,
                7.033600000000001,
                7.6384,
                8.281599999999997,
                8.9632,
                9.6832,
                10.441600000000001,
                11.2384,
                12.073600000000003,
                12.947200000000002,
                13.859200000000001,
                14.809600000000005,
                15.798399999999997,
                16.825599999999998,
                17.8912,
                18.995199999999997,
                20.1376
            ],
            [
                10.16,
                9.395199999999999,
                8.668800000000001,
                7.9807999999999995,
                7.331199999999999,
                6.720000000000001,
                6.1472,
                5.6128,
                5.1168000000000005,
                4.6592,
                4.24,
                3.8592000000000004,
                3.5168000000000004,
                3.2128,
                2.9472,
                2.7200000000000006,
                2.5312,
                2.3808000000000002,
                2.2688,
                2.1952000000000003,
                2.1600000000000006,
                2.1632000000000002,
                2.2048000000000005,
                2.2848000000000006,
                2.4032,
                2.5600000000000005,
                2.7552000000000003,
                2.9888,
                3.2608000000000006,
                3.571200000000001,
                3.9200000000000004,
                4.3072,
                4.732800000000001,
                5.196800000000001,
                5.699200000000002,
                6.240000000000002,
                6.8192,
                7.436800000000001,
                8.0928,
                8.787200000000002,
                9.52,
                10.2912,
                11.100800000000001,
                11.9488,
                12.8352,
                13.760000000000003,
                14.723200000000002,
                15.7248,
                16.764800000000005,
                17.843199999999996,
                18.96
            ],
            [
                10.3136,
                9.5232,
                8.7712,
                8.0576,
                7.382399999999999,
                6.745600000000001,
                6.1472,
                5.587199999999999,
                5.065600000000001,
                4.5824,
                4.1376,
                3.7312000000000003,
                3.3632,
                3.0336,
                2.7424,
                2.4896000000000003,
                2.2752,
                2.0992,
                1.9616,
                1.8624,
                1.8016,
                1.7792,
                1.7952,
                1.8496,
                1.9423999999999997,
                2.0736,
                2.2432,
                2.4511999999999996,
                2.6975999999999996,
                2.9824,
                3.3055999999999996,
                3.6672,
                4.0672,
                4.505600000000001,
                4.982400000000001,
                5.497600000000001,
                6.0512,
                6.643199999999999,
                7.273600000000001,
                7.9424,
                8.6496,
                9.395199999999999,
                10.1792,
                11.0016,
                11.862400000000001,
                12.761600000000001,
                13.699200000000001,
                14.675200000000002,
                15.689600000000002,
                16.742399999999996,
                17.833599999999997
            ],
            [
                10.5184,
                9.7024,
                8.924800000000001,
                8.1856,
                7.484799999999999,
                6.822400000000002,
                6.1983999999999995,
                5.6128,
                5.065600000000001,
                4.5568,
                4.0864,
                3.6544000000000003,
                3.2608,
                2.9055999999999997,
                2.5888,
                2.3104000000000005,
                2.0704000000000002,
                1.8688000000000002,
                1.7056,
                1.5808,
                1.4944000000000002,
                1.4464000000000001,
                1.4368,
                1.4656,
                1.5328,
                1.6384,
                1.7824000000000002,
                1.9648,
                2.1856,
                2.4448000000000008,
                2.7424000000000004,
                3.0784,
                3.4528000000000003,
                3.8656,
                4.3168,
                4.806400000000001,
                5.3344000000000005,
                5.900800000000001,
                6.505600000000002,
                7.148800000000002,
                7.8304,
                8.550400000000002,
                9.308800000000002,
                10.105599999999999,
                10.9408,
                11.814400000000001,
                12.726399999999998,
                13.6768,
                14.665600000000001,
                15.6928,
                16.7584
            ],
            [
                10.7744,
                9.932799999999999,
                9.1296,
                8.3648,
                7.638399999999999,
                6.950400000000002,
                6.300800000000001,
                5.6896,
                5.1168000000000005,
                4.5824,
                4.0864,
                3.6288000000000005,
                3.2096000000000005,
                2.8288,
                2.4864,
                2.1824000000000003,
                1.9168,
                1.6896,
                1.5008000000000001,
                1.3504,
                1.2384000000000002,
                1.1648,
                1.1296000000000002,
                1.1328000000000003,
                1.1744,
                1.2544000000000002,
                1.3728000000000002,
                1.5296,
                1.7248000000000003,
                1.9584000000000004,
                2.2304,
                2.5408000000000004,
                2.8896000000000006,
                3.2768000000000006,
                3.7024,
                4.166400000000001,
                4.6688,
                5.209600000000001,
                5.788800000000001,
                6.4064000000000005,
                7.062400000000001,
                7.756800000000001,
                8.489600000000003,
                9.260800000000001,
                10.070400000000001,
                10.918400000000004,
                11.804799999999998,
                12.7296,
                13.6928,
                14.6944,
                15.7344
            ],
            [
                11.0816,
                10.2144,
                9.3856,
                8.5952,
                7.843199999999999,
                7.129600000000002,
                6.4544,
                5.8176000000000005,
                5.219200000000001,
                4.6592,
                4.1376,
                3.6544000000000003,
                3.2096000000000005,
                2.8032,
                2.4352,
                2.1056000000000004,
                1.8144,
                1.5615999999999999,
                1.3472,
                1.1712,
                1.0335999999999999,
                0.9343999999999999,
                0.8735999999999999,
                0.8512,
                0.8672,
                0.9216,
                1.0144,
                1.1455999999999997,
                1.3152,
                1.5232,
                1.7696,
                2.0544,
                2.3776,
                2.7392000000000003,
                3.1391999999999998,
                3.5776000000000003,
                4.054399999999999,
                4.5696,
                5.1232,
                5.7152,
                6.3456,
                7.014400000000001,
                7.721600000000001,
                8.4672,
                9.2512,
                10.0736,
                10.934399999999997,
                11.833599999999999,
                12.7712,
                13.7472,
                14.761600000000001
            ],
            [
                11.44,
                10.5472,
                9.6928,
                8.8768,
                8.0992,
                7.360000000000001,
                6.6592,
                5.9968,
                5.372800000000001,
                4.7872,
                4.24,
                3.7312000000000003,
                3.2608,
                2.8288,
                2.4352,
                2.08,
                1.7631999999999999,
                1.4848,
                1.2448000000000001,
                1.0432000000000001,
                0.8800000000000001,
                0.7552000000000001,
                0.6688000000000001,
                0.6208,
                0.6112000000000001,
                0.6400000000000001,
                0.7072,
                0.8128000000000002,
                0.9568000000000001,
                1.1392000000000002,
                1.3600000000000003,
                1.6192000000000002,
                1.9168000000000003,
                2.2527999999999997,
                2.6272,
                3.040000000000001,
                3.4912,
                3.9807999999999995,
                4.5088,
                5.0752000000000015,
                5.68,
                6.323200000000001,
                7.0048,
                7.7248,
                8.483200000000002,
                9.280000000000003,
                10.1152,
                10.9888,
                11.9008,
                12.851199999999999,
                13.84
            ],
            [
                11.849599999999999,
                10.931199999999999,
                10.051200000000001,
                9.2096,
                8.4064,
                7.6416,
                6.9152000000000005,
                6.2272,
                5.577600000000001,
                4.9664,
                4.3936,
                3.8592000000000004,
                3.3632000000000004,
                2.9055999999999997,
                2.4864,
                2.1056000000000004,
                1.7631999999999999,
                1.4592,
                1.1936,
                0.9663999999999999,
                0.7776000000000001,
                0.6272,
                0.5152,
                0.4416,
                0.40640000000000004,
                0.4096,
                0.4512,
                0.5312000000000001,
                0.6496,
                0.8064,
                1.0016000000000003,
                1.2352000000000003,
                1.5072000000000005,
                1.8176,
                2.1663999999999994,
                2.5536000000000003,
                2.9792,
                3.4432,
                3.9456000000000007,
                4.486400000000001,
                5.065599999999999,
                5.6832,
                6.339200000000001,
                7.033600000000002,
                7.766400000000001,
                8.537600000000003,
                9.347199999999999,
                10.1952,
                11.081600000000002,
                12.006400000000001,
                12.9696
            ],
            [
                12.3104,
                11.3664,
                10.4608,
                9.5936,
                8.7648,
                7.974400000000001,
                7.2224,
                6.508799999999999,
                5.8336000000000015,
                5.1968000000000005,
                4.5984,
                4.038400000000001,
                3.5168000000000004,
                3.0336,
                2.5888,
                2.1824000000000003,
                1.8144,
                1.4848,
                1.1936,
                0.9408,
                0.7264000000000002,
                0.5504,
                0.4128,
                0.3136,
                0.25279999999999997,
                0.2304,
                0.2463999999999999,
                0.30080000000000007,
                0.39359999999999995,
                0.5248000000000002,
                0.6944,
                0.9024000000000001,
                1.1488,
                1.4336000000000002,
                1.7568,
                2.1184000000000003,
                2.5183999999999997,
                2.9568,
                3.4336,
                3.948800000000001,
                4.502399999999999,
                5.094399999999999,
                5.724800000000001,
                6.393599999999999,
                7.1008,
                7.846400000000001,
                8.6304,
                9.452800000000002,
                10.313600000000001,
                11.2128,
                12.150400000000001
            ],
            [
                12.8224,
                11.8528,
                10.9216,
                10.028799999999999,
                9.174399999999999,
                8.358400000000001,
                7.5808,
                6.8416,
                6.140800000000001,
                5.478400000000001,
                4.8544,
                4.268800000000001,
                3.7216000000000005,
                3.2127999999999997,
                2.7424,
                2.3104000000000005,
                1.9167999999999998,
                1.5616,
                1.2448000000000001,
                0.9663999999999999,
                0.7264000000000002,
                0.5248,
                0.3616,
                0.2368,
                0.1504,
                0.1024,
                0.09280000000000004,
                0.12160000000000001,
                0.18880000000000008,
                0.29440000000000005,
                0.4384,
                0.6208,
                0.8416000000000001,
                1.1008,
                1.3984000000000003,
                1.7344000000000006,
                2.1088,
                2.5216000000000003,
                2.9728000000000003,
                3.4624000000000006,
                3.9904,
                4.5568,
                5.161600000000001,
                5.8048,
                6.4864,
                7.206400000000002,
                7.9648,
                8.7616,
                9.596800000000002,
                10.4704,
                11.3824
            ],
            [
                13.3856,
                12.3904,
                11.4336,
                10.5152,
                9.6352,
                8.793600000000001,
                7.990400000000001,
                7.2256,
                6.499200000000001,
                5.8112,
                5.1616,
                4.550400000000001,
                3.9776000000000002,
                3.4432,
                2.9471999999999996,
                2.4896000000000003,
                2.0704,
                1.6896,
                1.3472000000000002,
                1.0432,
                0.7776000000000001,
                0.5504,
                0.3616,
                0.2112,
                0.09920000000000001,
                0.0256,
                -0.009599999999999997,
                -0.006399999999999989,
                0.03520000000000001,
                0.11520000000000002,
                0.23360000000000014,
                0.3904000000000001,
                0.5856000000000001,
                0.8192,
                1.0912,
                1.4016000000000004,
                1.7504,
                2.1376,
                2.5632,
                3.0272000000000006,
                3.5295999999999994,
                4.0704,
                4.6496,
                5.267199999999999,
                5.9232,
                6.617600000000001,
                7.350399999999999,
                8.121599999999999,
                8.9312,
                9.779200000000001,
                10.665600000000001
            ],
            [
                14.0,
                12.9792,
                11.9968,
                11.0528,
                10.147199999999998,
                9.280000000000001,
                8.4512,
                7.6608,
                6.908800000000001,
                6.195200000000001,
                5.5200000000000005,
                4.8832,
                4.284800000000001,
                3.7248,
                3.2032,
                2.7200000000000006,
                2.2752,
                1.8688000000000002,
                1.5008000000000001,
                1.1712,
                0.8800000000000001,
                0.6272,
                0.4128,
                0.2368,
                0.09920000000000001,
                0.0,
                -0.0608,
                -0.0832,
                -0.06719999999999998,
                -0.012799999999999978,
                0.08000000000000007,
                0.21120000000000005,
                0.3808,
                0.5888000000000001,
                0.8351999999999999,
                1.1200000000000003,
                1.4432,
                1.8048000000000002,
                2.2048000000000005,
                2.6432,
                3.12,
                3.6352,
                4.1888000000000005,
                4.780799999999999,
                5.411200000000001,
                6.080000000000002,
                6.787199999999999,
                7.5328,
                8.3168,
                9.1392,
                10.0
            ],
            [
                14.665600000000001,
                13.619200000000001,
                12.6112,
                11.641599999999999,
                10.710399999999998,
                9.8176,
                8.963199999999999,
                8.1472,
                7.369600000000001,
                6.630400000000001,
                5.9296,
                5.267200000000001,
                4.6432,
                4.0576,
                3.5103999999999997,
                3.0016000000000007,
                2.5312,
                2.0992,
                1.7056000000000002,
                1.3504,
                1.0336000000000003,
                0.7552000000000001,
                0.5152,
                0.3136,
                0.1504,
                0.0256,
                -0.0608,
                -0.10880000000000001,
                -0.11839999999999999,
                -0.08959999999999999,
                -0.022399999999999975,
                0.08319999999999994,
                0.22720000000000007,
                0.4096000000000001,
                0.6303999999999998,
                0.8896000000000002,
                1.1871999999999998,
                1.5232,
                1.8976000000000002,
                2.3104000000000005,
                2.7615999999999996,
                3.2512,
                3.7792000000000003,
                4.345599999999999,
                4.9504,
                5.593600000000002,
                6.2752,
                6.9952000000000005,
                7.7536000000000005,
                8.5504,
                9.3856
            ],
            [
                15.3824,
                14.3104,
                13.276800000000001,
                12.2816,
                11.3248,
                10.406400000000001,
                9.526399999999999,
                8.6848,
                7.8816000000000015,
                7.1168000000000005,
                6.3904000000000005,
                5.702400000000001,
                5.0528,
                4.4416,
                3.8688,
                3.3344000000000005,
                2.8384,
                2.3808000000000002,
                1.9616000000000002,
                1.5808,
                1.2384,
                0.9344000000000001,
                0.6688000000000001,
                0.4416,
                0.2528,
                0.1024,
                -0.009599999999999997,
                -0.0832,
                -0.11839999999999999,
                -0.1152,
                -0.07359999999999994,
                0.006400000000000017,
                0.12480000000000002,
                0.2816000000000001,
                0.4767999999999999,
                0.7104000000000001,
                0.9824,
                1.2927999999999997,
                1.6416000000000004,
                2.0288000000000004,
                2.4543999999999997,
                2.9184,
                3.4208000000000007,
                3.9615999999999993,
                4.540800000000001,
                5.1584,
                5.814399999999999,
                6.508799999999999,
                7.2416,
                8.0128,
                8.8224
            ],
            [
                16.1504,
                15.0528,
                13.9936,
                12.972800000000001,
                11.9904,
                11.0464,
                10.140799999999999,
                9.2736,
                8.4448,
                7.6544,
                6.902399999999999,
                6.188800000000001,
                5.5136,
                4.876799999999999,
                4.2783999999999995,
                3.7184,
                3.1967999999999996,
                2.7136000000000005,
                2.2688,
                1.8624,
                1.4944000000000002,
                1.1648,
                0.8735999999999999,
                0.6208,
                0.40639999999999993,
                0.2304,
                0.09279999999999998,
                -0.0064000000000000445,
                -0.06719999999999998,
                -0.08960000000000001,
                -0.07359999999999994,
                -0.019199999999999995,
                0.0736,
                0.20479999999999998,
                0.37440000000000007,
                0.5824000000000003,
                0.8288000000000001,
                1.1136,
                1.4368000000000003,
                1.7984000000000004,
                2.1983999999999995,
                2.6368,
                3.113600000000001,
                3.6287999999999996,
                4.1823999999999995,
                4.774400000000002,
                5.4048,
                6.0736,
                6.780800000000001,
                7.526400000000001,
                8.3104
            ],
            [
                16.9696,
                15.846400000000001,
                14.761600000000001,
                13.7152,
                12.707199999999998,
                11.737600000000002,
                10.8064,
                9.9136,
                9.0592,
                8.2432,
                7.465599999999999,
                6.726400000000001,
                6.025600000000001,
                5.3632,
                4.7392,
                4.1536,
                3.6064,
                3.0976000000000004,
                2.6272000000000006,
                2.1952000000000003,
                1.8016,
                1.4464000000000001,
                1.1296,
                0.8512000000000002,
                0.6112,
                0.4096,
                0.2464,
                0.12160000000000001,
                0.03520000000000001,
                -0.012799999999999978,
                -0.022399999999999975,
                0.006400000000000017,
                0.0736,
                0.17920000000000003,
                0.32319999999999993,
                0.5056000000000003,
                0.7264,
                0.9856,
                1.2832000000000003,
                1.6192000000000002,
                1.9936,
                2.4064000000000005,
                2.8576000000000006,
                3.3471999999999995,
                3.8752,
                4.441600000000001,
                5.046399999999999,
                5.6896,
                6.371200000000002,
                7.091199999999999,
                7.849599999999999
            ],
            [
                17.84,
                16.6912,
                15.5808,
                14.508799999999999,
                13.4752,
                12.480000000000002,
                11.523200000000001,
                10.6048,
                9.7248,
                8.8832,
                8.08,
                7.315200000000002,
                6.5888,
                5.900799999999999,
                5.2512,
                4.640000000000001,
                4.0672,
                3.5328,
                3.0368000000000004,
                2.5792,
                2.1600000000000006,
                1.7792000000000003,
                1.4368,
                1.1328000000000003,
                0.8672,
                0.6400000000000001,
                0.4512000000000001,
                0.30080000000000007,
                0.18880000000000008,
                0.11520000000000002,
                0.08000000000000007,
                0.08320000000000005,
                0.12480000000000002,
                0.20479999999999998,
                0.32319999999999993,
                0.4800000000000002,
                0.6751999999999999,
                0.9088,
                1.1808,
                1.4912,
                1.84,
                2.2272,
                2.6528,
                3.1168,
                3.6191999999999998,
                4.160000000000002,
                4.739199999999999,
                5.3568,
                6.0128,
                6.7072,
                7.4399999999999995
            ],
            [
                18.7616,
                17.5872,
                16.4512,
                15.353599999999998,
                14.294399999999996,
                13.2736,
                12.2912,
                11.347199999999999,
                10.441600000000001,
                9.5744,
                8.7456,
                7.9552000000000005,
                7.2032,
                6.4896,
                5.814399999999999,
                5.1776,
                4.579199999999999,
                4.0192000000000005,
                3.4976000000000003,
                3.0143999999999997,
                2.5696,
                2.1632000000000002,
                1.7952,
                1.4655999999999996,
                1.1744,
                0.9216,
                0.7072,
                0.5311999999999999,
                0.39359999999999995,
                0.29439999999999983,
                0.23359999999999992,
                0.21120000000000005,
                0.22719999999999996,
                0.28159999999999996,
                0.37440000000000007,
                0.5056000000000003,
                0.6751999999999999,
                0.8832,
                1.1296000000000004,
                1.4144,
                1.7375999999999998,
                2.0991999999999997,
                2.499200000000001,
                2.9376,
                3.4144,
                3.929600000000001,
                4.483199999999999,
                5.075200000000001,
                5.7056000000000004,
                6.3744,
                7.0816
            ],
            [
                19.7344,
                18.534399999999998,
                17.3728,
                16.2496,
                15.164799999999998,
                14.118400000000003,
                13.1104,
                12.1408,
                11.209600000000002,
                10.3168,
                9.4624,
                8.6464,
                7.868800000000001,
                7.129600000000001,
                6.4288,
                5.766400000000001,
                5.142399999999999,
                4.556800000000001,
                4.009600000000001,
                3.5008000000000004,
                3.0303999999999998,
                2.5984000000000003,
                2.2048000000000005,
                1.8496,
                1.5328000000000004,
                1.2544000000000002,
                1.0144,
                0.8128000000000002,
                0.6496000000000002,
                0.5248000000000002,
                0.4384000000000001,
                0.3904000000000002,
                0.3808,
                0.4096000000000001,
                0.4768000000000001,
                0.5824000000000003,
                0.7264,
                0.9088,
                1.1296000000000004,
                1.3888000000000003,
                1.6864000000000001,
                2.0224,
                2.3968000000000007,
                2.8096,
                3.2608,
                3.7504000000000013,
                4.2783999999999995,
                4.8448,
                5.4496,
                6.092799999999999,
                6.7744
            ],
            [
                20.7584,
                19.5328,
                18.3456,
                17.1968,
                16.086399999999998,
                15.0144,
                13.980799999999999,
                12.985599999999998,
                12.0288,
                11.1104,
                10.2304,
                9.388800000000003,
                8.585600000000003,
                7.820800000000001,
                7.0944,
                6.4064000000000005,
                5.756799999999999,
                5.1456,
                4.572800000000001,
                4.038399999999999,
                3.5424,
                3.0848000000000004,
                2.6656000000000004,
                2.2848,
                1.9424000000000003,
                1.6384,
                1.3727999999999998,
                1.1456000000000002,
                0.9568000000000001,
                0.8064,
                0.6944,
                0.6208,
                0.5855999999999999,
                0.5888000000000001,
                0.6304000000000001,
                0.7104000000000001,
                0.8288000000000001,
                0.9856,
                1.1808,
                1.4144,
                1.6864000000000001,
                1.9968000000000001,
                2.345600000000001,
                2.7327999999999997,
                3.1584,
                3.622400000000001,
                4.1248,
                4.6656,
                5.244800000000001,
                5.8624,
                6.5184
            ],
            [
                21.833599999999997,
                20.5824,
                19.369600000000002,
                18.195200000000003,
                17.0592,
                15.9616,
                14.9024,
                13.881599999999999,
                12.899199999999999,
                11.955199999999998,
                11.049599999999998,
                10.182400000000001,
                9.3536,
                8.563199999999998,
                7.8111999999999995,
                7.097600000000001,
                6.4224000000000006,
                5.7856000000000005,
                5.187200000000001,
                4.6272,
                4.1056,
                3.6224,
                3.1776,
                2.7712,
                2.4032,
                2.0736,
                1.7823999999999995,
                1.5296,
                1.3152,
                1.1391999999999998,
                1.0016000000000003,
                0.9024000000000001,
                0.8415999999999999,
                0.8192,
                0.8351999999999999,
                0.8896,
                0.9823999999999998,
                1.1136,
                1.2832,
                1.4912,
                1.7375999999999998,
                2.0224,
                2.345600000000001,
                2.7072,
                3.1072,
                3.5456000000000008,
                4.022399999999999,
                4.5376,
                5.091200000000001,
                5.6832,
                6.313599999999999
            ],
            [
                22.96,
                21.6832,
                20.444800000000004,
                19.2448,
                18.0832,
                16.960000000000004,
                15.8752,
                14.8288,
                13.8208,
                12.851199999999999,
                11.919999999999998,
                11.0272,
                10.172800000000002,
                9.3568,
                8.5792,
                7.840000000000002,
                7.1392000000000015,
                6.476800000000001,
                5.8528,
                5.267200000000001,
                4.720000000000001,
                4.211200000000001,
                3.7408,
                3.3088,
                2.9152000000000005,
                2.5600000000000005,
                2.2432,
                1.9648000000000005,
                1.7248000000000003,
                1.5232,
                1.3600000000000003,
                1.2352000000000003,
                1.1488,
                1.1008,
                1.0912000000000002,
                1.1200000000000003,
                1.1872000000000003,
                1.2928000000000002,
                1.4368000000000003,
                1.6192000000000002,
                1.84,
                2.0991999999999997,
                2.3968000000000007,
                2.7327999999999997,
                3.1072,
                3.520000000000001,
                3.9711999999999996,
                4.4608,
                4.9888,
                5.5552,
                6.16
            ],
            [
                24.1376,
                22.8352,
                21.5712,
                20.3456,
                19.158399999999997,
                18.009600000000006,
                16.8992,
                15.827200000000001,
                14.793600000000001,
                13.798399999999999,
                12.8416,
                11.923200000000001,
                11.043199999999999,
                10.2016,
                9.3984,
                8.633600000000001,
                7.9072000000000005,
                7.2192,
                6.569600000000001,
                5.958400000000001,
                5.385600000000001,
                4.8512,
                4.3552,
                3.8976,
                3.4784,
                3.0976,
                2.7551999999999994,
                2.4512000000000005,
                2.1856,
                1.9584,
                1.7696,
                1.6192000000000002,
                1.5072,
                1.4336000000000002,
                1.3984000000000003,
                1.4016,
                1.4432,
                1.5232,
                1.6416000000000004,
                1.7984,
                1.9936,
                2.2272,
                2.4992,
                2.8096,
                3.1584,
                3.5456000000000008,
                3.9711999999999996,
                4.4352,
                4.937600000000001,
                5.4784,
                6.057600000000001
            ],
            [
                25.3664,
                24.038400000000003,
                22.7488,
                21.4976,
                20.284799999999997,
                19.110400000000002,
                17.9744,
                16.8768,
                15.817600000000002,
                14.796800000000001,
                13.8144,
                12.8704,
                11.9648,
                11.0976,
                10.2688,
                9.4784,
                8.726399999999998,
                8.0128,
                7.3376,
                6.700799999999999,
                6.1024,
                5.542399999999999,
                5.0208,
                4.5376,
                4.0928,
                3.6864,
                3.318399999999999,
                2.9888,
                2.6975999999999996,
                2.4448,
                2.2304,
                2.0544,
                1.9167999999999998,
                1.8175999999999992,
                1.7568,
                1.7343999999999997,
                1.7504,
                1.8048000000000002,
                1.8976000000000002,
                2.0288,
                2.1983999999999995,
                2.4063999999999997,
                2.6528,
                2.9376,
                3.2608,
                3.622400000000001,
                4.022399999999999,
                4.4608,
                4.937600000000001,
                5.4528,
                6.006399999999999
            ],
            [
                26.6464,
                25.2928,
                23.9776,
                22.7008,
                21.4624,
                20.262400000000003,
                19.1008,
                17.9776,
                16.892800000000005,
                15.846400000000001,
                14.8384,
                13.868800000000004,
                12.9376,
                12.044799999999999,
                11.1904,
                10.374400000000001,
                9.5968,
                8.857600000000001,
                8.1568,
                7.494400000000001,
                6.870400000000001,
                6.2848,
                5.737600000000001,
                5.228800000000001,
                4.758400000000001,
                4.3264000000000005,
                3.9328000000000003,
                3.577600000000001,
                3.2608000000000006,
                2.9824,
                2.7424000000000004,
                2.5408000000000004,
                2.3776,
                2.2527999999999997,
                2.1664000000000003,
                2.1184000000000003,
                2.1088000000000005,
                2.1376,
                2.2048000000000005,
                2.3104000000000005,
                2.4543999999999997,
                2.6368,
                2.8576000000000006,
                3.1168,
                3.4144,
                3.7504000000000013,
                4.1248,
                4.5376,
                4.9888,
                5.4784,
                6.006399999999999
            ],
            [
                27.977600000000002,
                26.598400000000005,
                25.2576,
                23.9552,
                22.6912,
                21.465600000000006,
                20.2784,
                19.1296,
                18.019200000000005,
                16.947200000000002,
                15.913600000000002,
                14.918400000000002,
                13.9616,
                13.043200000000002,
                12.163200000000002,
                11.3216,
                10.5184,
                9.753600000000002,
                9.027200000000002,
                8.339200000000002,
                7.689600000000001,
                7.0784,
                6.505600000000002,
                5.971200000000001,
                5.475200000000002,
                5.017600000000001,
                4.598400000000001,
                4.2176,
                3.8751999999999995,
                3.571200000000001,
                3.3056000000000014,
                3.0784000000000007,
                2.8896000000000006,
                2.7392000000000003,
                2.627200000000001,
                2.5536000000000003,
                2.5184000000000006,
                2.5216000000000007,
                2.5632000000000006,
                2.6432,
                2.7616000000000005,
                2.9184,
                3.113600000000001,
                3.3472000000000004,
                3.6192000000000006,
                3.929600000000001,
                4.2783999999999995,
                4.6656,
                5.091200000000001,
                5.5552,
                6.057600000000001
            ],
            [
                29.360000000000003,
                27.955200000000005,
                26.588800000000003,
                25.260800000000003,
                23.9712,
                22.720000000000002,
                21.507199999999997,
                20.332800000000002,
                19.1968,
                18.0992,
                17.039999999999996,
                16.0192,
                15.0368,
                14.092799999999997,
                13.187199999999999,
                12.320000000000004,
                11.491200000000001,
                10.700800000000001,
                9.9488,
                9.2352,
                8.559999999999999,
                7.923199999999999,
                7.324799999999998,
                6.7648,
                6.243200000000001,
                5.76,
                5.3152,
                4.9087999999999985,
                4.5408,
                4.2112,
                3.9200000000000004,
                3.6672,
                3.4527999999999994,
                3.2767999999999993,
                3.1391999999999998,
                3.04,
                2.9792,
                2.9568,
                2.9728000000000003,
                3.0271999999999997,
                3.12,
                3.2512,
                3.4208,
                3.6287999999999996,
                3.8752,
                4.16,
                4.483199999999999,
                4.8448,
                5.244800000000001,
                5.6832,
                6.16
            ],
            [
                30.793600000000005,
                29.363200000000006,
                27.971200000000003,
                26.617600000000003,
                25.302400000000002,
                24.025600000000004,
                22.7872,
                21.5872,
                20.4256,
                19.302400000000002,
                18.217599999999997,
                17.171200000000002,
                16.1632,
                15.1936,
                14.2624,
                13.369600000000002,
                12.515200000000002,
                11.699200000000003,
                10.921600000000002,
                10.182400000000001,
                9.4816,
                8.8192,
                8.195199999999998,
                7.609600000000001,
                7.062400000000001,
                6.5536,
                6.083200000000001,
                5.651199999999999,
                5.257600000000001,
                4.9024,
                4.5856,
                4.3072,
                4.0672,
                3.8656,
                3.7024,
                3.5776000000000003,
                3.4912,
                3.4432,
                3.4336,
                3.4623999999999997,
                3.5296000000000003,
                3.6352,
                3.7792000000000003,
                3.9616000000000002,
                4.1823999999999995,
                4.441600000000001,
                4.739199999999999,
                5.075200000000001,
                5.4496,
                5.8624,
                6.313599999999999
            ],
            [
                32.278400000000005,
                30.82240000000001,
                29.404800000000005,
                28.025600000000004,
                26.684800000000003,
                25.382400000000004,
                24.1184,
                22.892800000000005,
                21.7056,
                20.556800000000003,
                19.446399999999997,
                18.374400000000005,
                17.3408,
                16.3456,
                15.388800000000002,
                14.470400000000005,
                13.590400000000002,
                12.748800000000003,
                11.945600000000002,
                11.180800000000003,
                10.454400000000001,
                9.7664,
                9.1168,
                8.505600000000001,
                7.932800000000002,
                7.398400000000001,
                6.902400000000001,
                6.4448,
                6.025600000000002,
                5.644800000000001,
                5.302400000000001,
                4.9984,
                4.732800000000001,
                4.505600000000001,
                4.3168,
                4.166400000000001,
                4.054400000000001,
                3.9808000000000012,
                3.9456000000000007,
                3.948800000000001,
                3.9904,
                4.0704,
                4.1888000000000005,
                4.345600000000001,
                4.540800000000001,
                4.774400000000002,
                5.0464,
                5.356800000000001,
                5.7056000000000004,
                6.0928,
                6.5184
            ],
            [
                33.8144,
                32.3328,
                30.889599999999998,
                29.4848,
                28.118399999999998,
                26.790400000000005,
                25.5008,
                24.249600000000004,
                23.036800000000003,
                21.862400000000004,
                20.726399999999998,
                19.628800000000002,
                18.569599999999998,
                17.5488,
                16.566399999999998,
                15.622399999999999,
                14.716799999999997,
                13.8496,
                13.0208,
                12.2304,
                11.478399999999999,
                10.7648,
                10.0896,
                9.4528,
                8.8544,
                8.2944,
                7.772799999999999,
                7.289599999999998,
                6.8447999999999976,
                6.4384,
                6.0704,
                5.7408,
                5.4496,
                5.1968,
                4.982400000000001,
                4.806400000000001,
                4.6688,
                4.5696,
                4.5088,
                4.4864,
                4.502399999999999,
                4.5568,
                4.6496,
                4.780799999999999,
                4.9504,
                5.1584,
                5.4048,
                5.6895999999999995,
                6.0128,
                6.3744,
                6.7744
            ],
            [
                35.4016,
                33.894400000000005,
                32.4256,
                30.9952,
                29.603199999999998,
                28.249600000000008,
                26.934400000000004,
                25.657600000000006,
                24.419200000000004,
                23.219200000000004,
                22.0576,
                20.934400000000004,
                19.8496,
                18.8032,
                17.795199999999998,
                16.8256,
                15.8944,
                15.001600000000002,
                14.147200000000002,
                13.3312,
                12.5536,
                11.8144,
                11.113600000000002,
                10.451200000000002,
                9.827200000000001,
                9.2416,
                8.6944,
                8.185599999999999,
                7.7151999999999985,
                7.283200000000001,
                6.889600000000001,
                6.5344,
                6.217600000000001,
                5.9392000000000005,
                5.699200000000002,
                5.497600000000001,
                5.3344000000000005,
                5.209600000000001,
                5.1232,
                5.0752,
                5.0656,
                5.094399999999999,
                5.1616,
                5.267200000000001,
                5.411200000000001,
                5.5936,
                5.8144,
                6.0736,
                6.3712,
                6.7072,
                7.0816
            ],
            [
                37.040000000000006,
                35.507200000000005,
                34.012800000000006,
                32.5568,
                31.1392,
                29.76000000000001,
                28.419200000000004,
                27.11680000000001,
                25.852800000000006,
                24.627200000000006,
                23.44,
                22.291200000000003,
                21.1808,
                20.108800000000002,
                19.0752,
                18.080000000000002,
                17.123199999999997,
                16.204800000000002,
                15.324800000000003,
                14.483200000000002,
                13.680000000000001,
                12.9152,
                12.188800000000002,
                11.500800000000002,
                10.851200000000002,
                10.240000000000002,
                9.667200000000001,
                9.1328,
                8.6368,
                8.179200000000002,
                7.760000000000002,
                7.379200000000001,
                7.036800000000001,
                6.732800000000001,
                6.467200000000003,
                6.240000000000002,
                6.0512000000000015,
                5.900800000000001,
                5.788800000000001,
                5.7152,
                5.68,
                5.6832,
                5.724800000000001,
                5.8048,
                5.923200000000001,
                6.080000000000002,
                6.2752,
                6.508800000000001,
                6.780800000000001,
                7.091200000000001,
                7.440000000000001
            ],
            [
                38.72959999999999,
                37.17119999999999,
                35.6512,
                34.169599999999996,
                32.726400000000005,
                31.321600000000004,
                29.955199999999998,
                28.6272,
                27.3376,
                26.0864,
                24.873599999999996,
                23.699200000000005,
                22.563200000000002,
                21.465600000000002,
                20.4064,
                19.385600000000004,
                18.4032,
                17.4592,
                16.5536,
                15.6864,
                14.8576,
                14.067199999999998,
                13.315199999999997,
                12.6016,
                11.9264,
                11.289599999999998,
                10.691199999999998,
                10.131199999999998,
                9.6096,
                9.1264,
                8.6816,
                8.2752,
                7.907199999999998,
                7.5775999999999994,
                7.286399999999998,
                7.033599999999998,
                6.8192,
                6.643199999999999,
                6.5056,
                6.406399999999999,
                6.3456,
                6.323200000000001,
                6.339199999999999,
                6.393599999999999,
                6.4864,
                6.617600000000001,
                6.787199999999999,
                6.995199999999999,
                7.2416,
                7.526400000000001,
                7.849599999999999
            ],
            [
                40.4704,
                38.886399999999995,
                37.34080000000001,
                35.8336,
                34.3648,
                32.934400000000004,
                31.5424,
                30.188800000000004,
                28.8736,
                27.5968,
                26.358399999999996,
                25.158400000000007,
                23.996800000000004,
                22.873600000000003,
                21.788800000000002,
                20.742400000000004,
                19.7344,
                18.7648,
                17.833599999999997,
                16.9408,
                16.086399999999998,
                15.2704,
                14.492799999999999,
                13.7536,
                13.052800000000001,
                12.3904,
                11.766399999999999,
                11.180799999999998,
                10.633600000000001,
                10.124800000000002,
                9.6544,
                9.2224,
                8.8288,
                8.4736,
                8.156799999999999,
                7.8784,
                7.6384,
                7.436800000000001,
                7.273600000000001,
                7.1488000000000005,
                7.062400000000001,
                7.014400000000001,
                7.0048,
                7.033600000000002,
                7.1008,
                7.2064,
                7.3504000000000005,
                7.5328,
                7.7536000000000005,
                8.0128,
                8.3104
            ],
            [
                42.2624,
                40.6528,
                39.08160000000001,
                37.54880000000001,
                36.0544,
                34.598400000000005,
                33.180800000000005,
                31.801600000000004,
                30.460800000000003,
                29.158400000000004,
                27.894399999999997,
                26.668800000000008,
                25.481600000000004,
                24.332800000000006,
                23.222400000000004,
                22.150400000000005,
                21.1168,
                20.1216,
                19.1648,
                18.2464,
                17.3664,
                16.5248,
                15.721599999999999,
                14.956800000000003,
                14.230400000000003,
                13.5424,
                12.892800000000001,
                12.2816,
                11.708800000000002,
                11.174400000000002,
                10.678400000000002,
                10.220800000000002,
                9.8016,
                9.4208,
                9.078399999999998,
                8.7744,
                8.5088,
                8.281600000000001,
                8.0928,
                7.9424,
                7.830400000000002,
                7.756800000000001,
                7.721600000000001,
                7.7248,
                7.766400000000001,
                7.846400000000001,
                7.9648,
                8.1216,
                8.3168,
                8.550400000000002,
                8.8224
            ],
            [
                44.105599999999995,
                42.4704,
                40.8736,
                39.3152,
                37.795199999999994,
                36.3136,
                34.8704,
                33.46559999999999,
                32.0992,
                30.771200000000004,
                29.4816,
                28.230400000000003,
                27.017599999999998,
                25.8432,
                24.707199999999997,
                23.6096,
                22.550399999999996,
                21.529599999999995,
                20.5472,
                19.6032,
                18.6976,
                17.8304,
                17.0016,
                16.2112,
                15.4592,
                14.7456,
                14.0704,
                13.433599999999997,
                12.835199999999997,
                12.2752,
                11.753599999999999,
                11.270399999999999,
                10.825599999999998,
                10.419199999999998,
                10.0512,
                9.721599999999999,
                9.430399999999999,
                9.177599999999998,
                8.9632,
                8.787199999999999,
                8.6496,
                8.550399999999998,
                8.4896,
                8.4672,
                8.4832,
                8.5376,
                8.6304,
                8.7616,
                8.9312,
                9.1392,
                9.3856
            ],
            [
                46.0,
                44.3392,
                42.7168,
                41.132799999999996,
                39.587199999999996,
                38.08,
                36.6112,
                35.18079999999999,
                33.7888,
                32.4352,
                31.12,
                29.843200000000003,
                28.6048,
                27.4048,
                26.243199999999998,
                25.12,
                24.035199999999996,
                22.988799999999998,
                21.980800000000002,
                21.011200000000002,
                20.080000000000002,
                19.1872,
                18.332800000000002,
                17.516800000000003,
                16.739199999999997,
                16.0,
                15.299199999999999,
                14.6368,
                14.012799999999999,
                13.427200000000001,
                12.88,
                12.3712,
                11.900799999999998,
                11.468799999999998,
                11.0752,
                10.720000000000002,
                10.4032,
                10.1248,
                9.884799999999998,
                9.6832,
                9.52,
                9.395199999999999,
                9.3088,
                9.260800000000001,
                9.2512,
                9.280000000000001,
                9.3472,
                9.452800000000002,
                9.596800000000002,
                9.779200000000001,
                10.0
            ]
        ],
        "zmax": 46.0,
        "y": [
            -2.0,
            -1.92,
            -1.84,
            -1.76,
            -1.68,
            -1.6,
            -1.52,
            -1.44,
            -1.36,
            -1.28,
            -1.2,
            -1.12,
            -1.04,
            -0.96,
            -0.88,
            -0.8,
            -0.72,
            -0.64,
            -0.56,
            -0.48,
            -0.4,
            -0.32,
            -0.24,
            -0.16,
            -0.08,
            0.0,
            0.08,
            0.16,
            0.24,
            0.32,
            0.4,
            0.48,
            0.56,
            0.64,
            0.72,
            0.8,
            0.88,
            0.96,
            1.04,
            1.12,
            1.2,
            1.28,
            1.36,
            1.44,
            1.52,
            1.6,
            1.68,
            1.76,
            1.84,
            1.92,
            2.0
        ],
        "type": "contour",
        "contours": {
            "showlabels": false,
            "coloring": "fill"
        },
        "ncontours": 17,
        "showscale": true,
        "x": [
            -2.0,
            -1.92,
            -1.84,
            -1.76,
            -1.68,
            -1.6,
            -1.52,
            -1.44,
            -1.36,
            -1.28,
            -1.2,
            -1.12,
            -1.04,
            -0.96,
            -0.88,
            -0.8,
            -0.72,
            -0.64,
            -0.56,
            -0.48,
            -0.4,
            -0.32,
            -0.24,
            -0.16,
            -0.08,
            0.0,
            0.08,
            0.16,
            0.24,
            0.32,
            0.4,
            0.48,
            0.56,
            0.64,
            0.72,
            0.8,
            0.88,
            0.96,
            1.04,
            1.12,
            1.2,
            1.28,
            1.36,
            1.44,
            1.52,
            1.6,
            1.68,
            1.76,
            1.84,
            1.92,
            2.0
        ]
    }
], {
    "showlegend": true,
    "xaxis": {
        "showticklabels": true,
        "gridwidth": 0.5,
        "tickvals": [
            -2.0,
            -1.0,
            0.0,
            1.0,
            2.0
        ],
        "range": [
            -2.0,
            2.0
        ],
        "domain": [
            0.061654272382618835,
            0.760492308253135
        ],
        "mirror": false,
        "tickangle": 0,
        "showline": true,
        "ticktext": [
            "−2",
            "−1",
            "0",
            "1",
            "2"
        ],
        "zeroline": false,
        "tickfont": {
            "color": "rgba(0, 0, 0, 1.000)",
            "family": "sans-serif",
            "size": 11
        },
        "zerolinecolor": "rgba(0, 0, 0, 1.000)",
        "anchor": "y",
        "visible": true,
        "ticks": "inside",
        "tickmode": "array",
        "linecolor": "rgba(0, 0, 0, 1.000)",
        "showgrid": true,
        "title": "Parameter 1",
        "gridcolor": "rgba(0, 0, 0, 0.100)",
        "titlefont": {
            "color": "rgba(0, 0, 0, 1.000)",
            "family": "sans-serif",
            "size": 15
        },
        "tickcolor": "rgb(0, 0, 0)",
        "type": "-"
    },
    "paper_bgcolor": "rgba(255, 255, 255, 1.000)",
    "annotations": [],
    "height": 400,
    "margin": {
        "l": 0,
        "b": 20,
        "r": 0,
        "t": 20
    },
    "plot_bgcolor": "rgba(255, 255, 255, 1.000)",
    "yaxis": {
        "showticklabels": true,
        "gridwidth": 0.5,
        "tickvals": [
            -2.0,
            -1.0,
            0.0,
            1.0,
            2.0
        ],
        "range": [
            -2.0,
            2.0
        ],
        "domain": [
            0.07581474190726165,
            0.9901574803149606
        ],
        "mirror": false,
        "tickangle": 0,
        "showline": true,
        "ticktext": [
            "−2",
            "−1",
            "0",
            "1",
            "2"
        ],
        "zeroline": false,
        "tickfont": {
            "color": "rgba(0, 0, 0, 1.000)",
            "family": "sans-serif",
            "size": 11
        },
        "zerolinecolor": "rgba(0, 0, 0, 1.000)",
        "anchor": "x",
        "visible": true,
        "ticks": "inside",
        "tickmode": "array",
        "linecolor": "rgba(0, 0, 0, 1.000)",
        "showgrid": true,
        "title": "Parameter 2",
        "gridcolor": "rgba(0, 0, 0, 0.100)",
        "titlefont": {
            "color": "rgba(0, 0, 0, 1.000)",
            "family": "sans-serif",
            "size": 15
        },
        "tickcolor": "rgb(0, 0, 0)",
        "type": "-"
    },
    "legend": {
        "yanchor": "auto",
        "xanchor": "auto",
        "bordercolor": "rgba(0, 0, 0, 1.000)",
        "bgcolor": "rgba(255, 255, 255, 1.000)",
        "borderwidth": 1,
        "tracegroupgap": 0,
        "y": 1.0,
        "font": {
            "color": "rgba(0, 0, 0, 1.000)",
            "family": "sans-serif",
            "size": 11
        },
        "title": {
            "font": {
                "color": "rgba(0, 0, 0, 1.000)",
                "family": "sans-serif",
                "size": 15
            },
            "text": ""
        },
        "traceorder": "normal",
        "x": 1.0
    },
    "width": 600
});
        
    }
    let plotlyloader = window.document.createElement("script")
    let src="https://requirejs.org/docs/release/2.3.7/minified/require.js"
    plotlyloader.addEventListener("load", plots_jl_plotly_id_ab4ae0a4_51e5_43fc_8431_071b88381e89);
    plotlyloader.src = src
    document.querySelector("#id_ab4ae0a4_51e5_43fc_8431_071b88381e89").appendChild(plotlyloader)
    })()
    </script>
mimetext/htmlrootassigneelast_run_timestampA(persist_js_state·has_pluto_hook_features§cell_id$cd7c244d-8a4c-4aaf-ad4b-891744e004bedepends_on_disabled_cells§runtime۵published_object_keysdepends_on_skipped_cells§errored$ed873ea2-d4bd-46e7-b89b-4e5494b606e6queued¤logsrunning¦outputbodymsg,UndefVarError: `GradientDescent` not definedstacktracecall_shorttop-level scopeinlined£urlpathu/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#ed873ea2-d4bd-46e7-b89b-4e5494b606e6source_packagecalltop-level scopelinfo_typeCore.CodeInfolinefile:H3_Custom_Types.jl#==#ed873ea2-d4bd-46e7-b89b-4e5494b606e6functop-level scopeparent_modulefrom_c«plain_errorٿUndefVarError: `GradientDescent` not defined
Stacktrace:
 [1] top-level scope
   @ ~/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jl#==#ed873ea2-d4bd-46e7-b89b-4e5494b606e6:1mime'application/vnd.pluto.stacktrace+objectrootassigneeoptimizerslast_run_timestampA(԰persist_js_state·has_pluto_hook_features§cell_id$ed873ea2-d4bd-46e7-b89b-4e5494b606e6depends_on_disabled_cells§runtimepublished_object_keysdepends_on_skipped_cells§errored$b3832fb6-dd19-4b38-8117-b0a11d1bc34fqueued¤logsrunning¦outputbody<div class="markdown"><h3 id="Interlude:-Understanding-Optimisers.jl">Interlude: Understanding Optimisers.jl</h3>
<p>All optimization algorithms in Optimisers.jl are sub-types of the abstract type <code>AbstractRule</code>.</p>
<p>To extend Optimisers.jl, we simply need to define a custom sub-type and overload two functions <code>init</code> and <code>apply&#33;</code> using multiple dispatch.</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(?persist_js_state·has_pluto_hook_features§cell_id$b3832fb6-dd19-4b38-8117-b0a11d1bc34fdepends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$bdcb27c5-0603-49ac-b831-d78c558b31f0queued¤logsrunning¦outputbody]<div class="markdown"><p>Due date: <strong>Monday, May 11th 2026 at 23:59</strong></p>
</div>mimetext/htmlrootassigneelast_run_timestampA(
persist_js_state·has_pluto_hook_features§cell_id$bdcb27c5-0603-49ac-b831-d78c558b31f0depends_on_disabled_cells§runtime <published_object_keysdepends_on_skipped_cells§errored$33866006-11d7-46cc-870b-fec519a2b541queued¤logsrunning¦outputbody<div class="markdown"><div class="admonition tip"><p class="admonition-title">Tip</p><p>The purpose of this exercise is to teach you how to extend functionality from external Julia packages.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|fdpersist_js_state·has_pluto_hook_features§cell_id$33866006-11d7-46cc-870b-fec519a2b541depends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$44ec9e94-f6af-431e-8841-bae44431dfa3queued¤logsrunning¦outputbody<div class="markdown"><div class="admonition warning"><p class="admonition-title">Missing Response</p><p>Please replace <code>&quot;Mara Mustermann&quot;</code> with your name. Use <code>Shift&#43;Enter</code> to run your edits.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA({,䂰persist_js_state·has_pluto_hook_features§cell_id$44ec9e94-f6af-431e-8841-bae44431dfa3depends_on_disabled_cells§runtimespublished_object_keysdepends_on_skipped_cells§errored$57a8108f-9ad3-4cc2-9372-bb291fc3bf86queued¤logsrunning¦outputbodyP<script>
	
// Load the library for consistent smooth scrolling
const {default: scrollIntoView} = await import("data:text/javascript;base64,dmFyIFE9ZT0+Im9iamVjdCI9PXR5cGVvZiBlJiZudWxsIT1lJiYxPT09ZS5ub2RlVHlwZSxVPShlLHQpPT4oIXR8fCJoaWRkZW4iIT09ZSkmJiJ2aXNpYmxlIiE9PWUmJiJjbGlwIiE9PWUsQT0oZSx0KT0+e2lmKGUuY2xpZW50SGVpZ2h0PGUuc2Nyb2xsSGVpZ2h0fHxlLmNsaWVudFdpZHRoPGUuc2Nyb2xsV2lkdGgpe2xldCBsPWdldENvbXB1dGVkU3R5bGUoZSxudWxsKTtyZXR1cm4gVShsLm92ZXJmbG93WSx0KXx8VShsLm92ZXJmbG93WCx0KXx8KGU9PntsZXQgdD0oZT0+e2lmKCFlLm93bmVyRG9jdW1lbnR8fCFlLm93bmVyRG9jdW1lbnQuZGVmYXVsdFZpZXcpcmV0dXJuIG51bGw7dHJ5e3JldHVybiBlLm93bmVyRG9jdW1lbnQuZGVmYXVsdFZpZXcuZnJhbWVFbGVtZW50fWNhdGNoe3JldHVybiBudWxsfX0pKGUpO3JldHVybiEhdCYmKHQuY2xpZW50SGVpZ2h0PGUuc2Nyb2xsSGVpZ2h0fHx0LmNsaWVudFdpZHRoPGUuc2Nyb2xsV2lkdGgpfSkoZSl9cmV0dXJuITF9LFg9KGUsdCxsLG8sbixyLGkscyk9PnI8ZSYmaT50fHxyPmUmJmk8dD8wOnI8PWUmJnM8PWx8fGk+PXQmJnM+PWw/ci1lLW86aT50JiZzPGx8fHI8ZSYmcz5sP2ktdCtuOjAsJD1lPT5lLnBhcmVudEVsZW1lbnQ/PyhlLmdldFJvb3ROb2RlKCkuaG9zdHx8bnVsbCksdHQ9KGUsdCk9Pnt2YXIgbCxvLG4scjtpZih0eXBlb2YgZG9jdW1lbnQ+InUiKXJldHVybltdO2xldHtzY3JvbGxNb2RlOmksYmxvY2s6cyxpbmxpbmU6YSxib3VuZGFyeTpoLHNraXBPdmVyZmxvd0hpZGRlbkVsZW1lbnRzOnV9PXQsZz0iZnVuY3Rpb24iPT10eXBlb2YgaD9oOmU9PmUhPT1oO2lmKCFRKGUpKXRocm93IFR5cGVFcnJvcigiSW52YWxpZCB0YXJnZXQiKTtsZXQgdj1kb2N1bWVudC5zY3JvbGxpbmdFbGVtZW50fHxkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQsbT1bXSx3PWU7Zm9yKDtRKHcpJiZnKHcpOyl7aWYoKHc9JCh3KSk9PT12KXttLnB1c2godyk7YnJlYWt9bnVsbCE9dyYmdz09PWRvY3VtZW50LmJvZHkmJkEodykmJiFBKGRvY3VtZW50LmRvY3VtZW50RWxlbWVudCl8fG51bGwhPXcmJkEodyx1KSYmbS5wdXNoKHcpfWxldCBXPW51bGwhPShvPW51bGw9PShsPXdpbmRvdy52aXN1YWxWaWV3cG9ydCk/dm9pZCAwOmwud2lkdGgpP286aW5uZXJXaWR0aCxIPW51bGwhPShyPW51bGw9PShuPXdpbmRvdy52aXN1YWxWaWV3cG9ydCk/dm9pZCAwOm4uaGVpZ2h0KT9yOmlubmVySGVpZ2h0LHtzY3JvbGxYOl8sc2Nyb2xsWTp4fT13aW5kb3cse2hlaWdodDpFLHdpZHRoOlQsdG9wOk4scmlnaHQ6TCxib3R0b206WSxsZWZ0OkN9PWUuZ2V0Qm91bmRpbmdDbGllbnRSZWN0KCksUj0ic3RhcnQiPT09c3x8Im5lYXJlc3QiPT09cz9OOiJlbmQiPT09cz9ZOk4rRS8yLFY9ImNlbnRlciI9PT1hP0MrVC8yOiJlbmQiPT09YT9MOkMsQj1bXTtmb3IobGV0IEQ9MDtEPG0ubGVuZ3RoO0QrKyl7bGV0IE89bVtEXSx7aGVpZ2h0Omosd2lkdGg6SSx0b3A6UyxyaWdodDpxLGJvdHRvbTp6LGxlZnQ6Rn09Ty5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKTtpZigiaWYtbmVlZGVkIj09PWkmJk4+PTAmJkM+PTAmJlk8PUgmJkw8PVcmJk4+PVMmJlk8PXomJkM+PUYmJkw8PXEpYnJlYWs7bGV0IEc9Z2V0Q29tcHV0ZWRTdHlsZShPKSxKPXBhcnNlSW50KEcuYm9yZGVyTGVmdFdpZHRoLDEwKSxLPXBhcnNlSW50KEcuYm9yZGVyVG9wV2lkdGgsMTApLFA9cGFyc2VJbnQoRy5ib3JkZXJSaWdodFdpZHRoLDEwKSxaPXBhcnNlSW50KEcuYm9yZGVyQm90dG9tV2lkdGgsMTApLGVlPTAsZXQ9MCxlbD0ib2Zmc2V0V2lkdGgiaW4gTz9PLm9mZnNldFdpZHRoLU8uY2xpZW50V2lkdGgtSi1QOjAsZW89Im9mZnNldEhlaWdodCJpbiBPP08ub2Zmc2V0SGVpZ2h0LU8uY2xpZW50SGVpZ2h0LUstWjowLGVuPSJvZmZzZXRXaWR0aCJpbiBPPzA9PT1PLm9mZnNldFdpZHRoPzA6SS9PLm9mZnNldFdpZHRoOjAsZXI9Im9mZnNldEhlaWdodCJpbiBPPzA9PT1PLm9mZnNldEhlaWdodD8wOmovTy5vZmZzZXRIZWlnaHQ6MDtpZih2PT09TyllZT0ic3RhcnQiPT09cz9SOiJlbmQiPT09cz9SLUg6Im5lYXJlc3QiPT09cz9YKHgseCtILEgsSyxaLHgrUix4K1IrRSxFKTpSLUgvMixldD0ic3RhcnQiPT09YT9WOiJjZW50ZXIiPT09YT9WLVcvMjoiZW5kIj09PWE/Vi1XOlgoXyxfK1csVyxKLFAsXytWLF8rVitULFQpLGVlPU1hdGgubWF4KDAsZWUreCksZXQ9TWF0aC5tYXgoMCxldCtfKTtlbHNle2VlPSJzdGFydCI9PT1zP1ItUy1LOiJlbmQiPT09cz9SLXorWitlbzoibmVhcmVzdCI9PT1zP1goUyx6LGosSyxaK2VvLFIsUitFLEUpOlItKFMrai8yKStlby8yLGV0PSJzdGFydCI9PT1hP1YtRi1KOiJjZW50ZXIiPT09YT9WLShGK0kvMikrZWwvMjoiZW5kIj09PWE/Vi1xK1ArZWw6WChGLHEsSSxKLFArZWwsVixWK1QsVCk7bGV0e3Njcm9sbExlZnQ6ZWksc2Nyb2xsVG9wOmVkfT1PO2VlPU1hdGgubWF4KDAsTWF0aC5taW4oZWQrZWUvZXIsTy5zY3JvbGxIZWlnaHQtai9lcitlbykpLGV0PU1hdGgubWF4KDAsTWF0aC5taW4oZWkrZXQvZW4sTy5zY3JvbGxXaWR0aC1JL2VuK2VsKSksUis9ZWQtZWUsVis9ZWktZXR9Qi5wdXNoKHtlbDpPLHRvcDplZSxsZWZ0OmV0fSl9cmV0dXJuIEJ9LGY9ZT0+e3ZhciB0O3JldHVybiExPT09ZT97YmxvY2s6ImVuZCIsaW5saW5lOiJuZWFyZXN0In06KHQ9ZSk9PT1PYmplY3QodCkmJjAhPT1PYmplY3Qua2V5cyh0KS5sZW5ndGg/ZTp7YmxvY2s6InN0YXJ0IixpbmxpbmU6Im5lYXJlc3QifX07ZnVuY3Rpb24gYyhlLHQpe3ZhciBsO2lmKCFlLmlzQ29ubmVjdGVkfHwhKGU9PntsZXQgdD1lO2Zvcig7dCYmdC5wYXJlbnROb2RlOyl7aWYodC5wYXJlbnROb2RlPT09ZG9jdW1lbnQpcmV0dXJuITA7dD10LnBhcmVudE5vZGUgaW5zdGFuY2VvZiBTaGFkb3dSb290P3QucGFyZW50Tm9kZS5ob3N0OnQucGFyZW50Tm9kZX1yZXR1cm4hMX0pKGUpKXJldHVybjtpZigib2JqZWN0Ij09dHlwZW9mKGw9dCkmJiJmdW5jdGlvbiI9PXR5cGVvZiBsLmJlaGF2aW9yKXJldHVybiB0LmJlaGF2aW9yKHR0KGUsdCkpO2xldCBvPSJib29sZWFuIj09dHlwZW9mIHR8fG51bGw9PXQ/dm9pZCAwOnQuYmVoYXZpb3I7Zm9yKGxldHtlbDpuLHRvcDpyLGxlZnQ6aX1vZiB0dChlLGYodCkpKW4uc2Nyb2xsKHt0b3A6cixsZWZ0OmksYmVoYXZpb3I6b30pfXZhciBkLHA9KCk9PihkfHwoZD0icGVyZm9ybWFuY2UiaW4gd2luZG93P3BlcmZvcm1hbmNlLm5vdy5iaW5kKHBlcmZvcm1hbmNlKTpEYXRlLm5vdyksZCgpKTtmdW5jdGlvbiBiKGUpe2xldCB0PU1hdGgubWluKChwKCktZS5zdGFydFRpbWUpL2UuZHVyYXRpb24sMSksbD1lLmVhc2UodCksbz1lLnN0YXJ0WCsoZS54LWUuc3RhcnRYKSpsLG49ZS5zdGFydFkrKGUueS1lLnN0YXJ0WSkqbDtlLm1ldGhvZChvLG4sdCxsKSxvIT09ZS54fHxuIT09ZS55P3JlcXVlc3RBbmltYXRpb25GcmFtZSgoKT0+YihlKSk6ZS5jYigpfWZ1bmN0aW9uIHkoZSx0LGwpe2xldCBvPWFyZ3VtZW50cy5sZW5ndGg+MyYmdm9pZCAwIT09YXJndW1lbnRzWzNdP2FyZ3VtZW50c1szXTo2MDAsbj1hcmd1bWVudHMubGVuZ3RoPjQmJnZvaWQgMCE9PWFyZ3VtZW50c1s0XT9hcmd1bWVudHNbNF06ZT0+MSstLWUqZSplKmUqZSxyPWFyZ3VtZW50cy5sZW5ndGg+NT9hcmd1bWVudHNbNV06dm9pZCAwLGk9YXJndW1lbnRzLmxlbmd0aD42P2FyZ3VtZW50c1s2XTp2b2lkIDAscz1lLnNjcm9sbExlZnQsYT1lLnNjcm9sbFRvcDtiKHtzY3JvbGxhYmxlOmUsbWV0aG9kKHQsbCxvLG4pe2xldCByPU1hdGguY2VpbCh0KSxzPU1hdGguY2VpbChsKTtlLnNjcm9sbExlZnQ9cixlLnNjcm9sbFRvcD1zLGk/Lih7dGFyZ2V0OmUsZWxhcHNlZDpvLHZhbHVlOm4sbGVmdDpyLHRvcDpzfSl9LHN0YXJ0VGltZTpwKCksc3RhcnRYOnMsc3RhcnRZOmEseDp0LHk6bCxkdXJhdGlvbjpvLGVhc2U6bixjYjpyfSl9dmFyIE09ZT0+ZSYmIWUuYmVoYXZpb3J8fCJzbW9vdGgiPT09ZS5iZWhhdmlvcixrPWZ1bmN0aW9uKGUsdCl7bGV0IGw9dHx8e307cmV0dXJuIE0obCk/YyhlLHtibG9jazpsLmJsb2NrLGlubGluZTpsLmlubGluZSxzY3JvbGxNb2RlOmwuc2Nyb2xsTW9kZSxib3VuZGFyeTpsLmJvdW5kYXJ5LHNraXBPdmVyZmxvd0hpZGRlbkVsZW1lbnRzOmwuc2tpcE92ZXJmbG93SGlkZGVuRWxlbWVudHMsYmVoYXZpb3I6ZT0+UHJvbWlzZS5hbGwoZS5yZWR1Y2UoKGUsdCk9PntsZXR7ZWw6byxsZWZ0Om4sdG9wOnJ9PXQsaT1vLnNjcm9sbExlZnQscz1vLnNjcm9sbFRvcDtyZXR1cm4gaT09PW4mJnM9PT1yP2U6Wy4uLmUsbmV3IFByb21pc2UoZT0+eShvLG4scixsLmR1cmF0aW9uLGwuZWFzZSwoKT0+ZSh7ZWw6byxsZWZ0OltpLG5dLHRvcDpbcyxyXX0pLGwub25TY3JvbGxDaGFuZ2UpKV19LFtdKSl9KTpQcm9taXNlLnJlc29sdmUoYyhlLHQpKX07ZXhwb3J0e2sgYXMgZGVmYXVsdH07")

const indent = true
const aside = true
const title_text = "Table of Contents"
const include_definitions = false


const tocNode = html`<nav class="plutoui-toc">
	<header>
	 <span class="toc-toggle open-toc"></span>
	 <span class="toc-toggle closed-toc"></span>
	 ${title_text}
	</header>
	<section></section>
</nav>`

tocNode.classList.toggle("aside", aside)
tocNode.classList.toggle("indent", indent)


const getParentCell = el => el.closest("pluto-cell")

const getHeaders = () => {
	const depth = Math.max(1, Math.min(6, 3)) // should be in range 1:6
	const range = Array.from({length: depth}, (x, i) => i+1) // [1, ..., depth]
	
	const selector = [
		...(include_definitions ? [
			`pluto-notebook pluto-cell .pluto-docs-binding`, 
			`pluto-notebook pluto-cell assignee:not(:empty)`, 
		] : []),
		...range.map(i => `pluto-notebook pluto-cell h${i}`)
	].join(",")
	return Array.from(document.querySelectorAll(selector)).filter(el => 
		// exclude headers inside of a pluto-docs-binding block
		!(el.nodeName.startsWith("H") && el.closest(".pluto-docs-binding")) && !el.classList.contains("no-toc")
	)
}


const document_click_handler = (event) => {
	const path = (event.path || event.composedPath())
	const toc = path.find(elem => elem?.classList?.contains?.("toc-toggle"))
	if (toc) {
		event.stopImmediatePropagation()
		toc.closest(".plutoui-toc").classList.toggle("hide")
	}
}

document.addEventListener("click", document_click_handler)


const header_to_index_entry_map = new Map()
const currently_highlighted_set = new Set()

const last_toc_element_click_time = { current: 0 }

const intersection_callback = (ixs) => {
	let on_top = ixs.filter(ix => ix.intersectionRatio > 0 && ix.intersectionRect.y < ix.rootBounds.height / 2)
	if(on_top.length > 0){
		currently_highlighted_set.forEach(a => a.classList.remove("in-view"))
		currently_highlighted_set.clear()
		on_top.slice(0,1).forEach(i => {
			let div = header_to_index_entry_map.get(i.target)
			div.classList.add("in-view")
			currently_highlighted_set.add(div)
			
			/// scroll into view
			/*
			const toc_height = tocNode.offsetHeight
			const div_pos = div.offsetTop
			const div_height = div.offsetHeight
			const current_scroll = tocNode.scrollTop
			const header_height = tocNode.querySelector("header").offsetHeight
			
			const scroll_to_top = div_pos - header_height
			const scroll_to_bottom = div_pos + div_height - toc_height
			
			// if we set a scrollTop, then the browser will stop any currently ongoing smoothscroll animation. So let's only do this if you are not currently in a smoothscroll.
			if(Date.now() - last_toc_element_click_time.current >= 2000)
				if(current_scroll < scroll_to_bottom){
					tocNode.scrollTop = scroll_to_bottom
				} else if(current_scroll > scroll_to_top){
					tocNode.scrollTop = scroll_to_top
				}
			*/
		})
	}
}
let intersection_observer_1 = new IntersectionObserver(intersection_callback, {
	root: null, // i.e. the viewport
  	threshold: 1,
	rootMargin: "-15px", // slightly smaller than the viewport
	// delay: 100,
})
let intersection_observer_2 = new IntersectionObserver(intersection_callback, {
	root: null, // i.e. the viewport
  	threshold: 1,
	rootMargin: "15px", // slightly larger than the viewport
	// delay: 100,
})

const render = (elements) => {
	header_to_index_entry_map.clear()
	currently_highlighted_set.clear()
	intersection_observer_1.disconnect()
	intersection_observer_2.disconnect()

		let last_level = `H1`
	return html`${elements.map(h => {
	const parent_cell = getParentCell(h)

		let [className, title_el] = h.matches(`.pluto-docs-binding`) ? ["pluto-docs-binding-el", h.firstElementChild] : [h.nodeName, h]

	const id = title_el.matches("assignee") ?
		title_el.innerText.replace(/^const /, "") :
		title_el.id ?
		title_el.id :
		parent_cell.id
	
	const inner_html = title_el.innerHTML
		
	const a = html`<a 
		class="${className}" 
		title="${title_el.innerText}"
		href="#${id}"
	>${inner_html}</a>`
	/* a.onmouseover=()=>{
		parent_cell.firstElementChild.classList.add(
			'highlight-pluto-cell-shoulder'
		)
	}
	a.onmouseout=() => {
		parent_cell.firstElementChild.classList.remove(
			'highlight-pluto-cell-shoulder'
		)
	} */
		
		
	a.onclick=(e) => {
		e.preventDefault();
		history.replaceState(null, null, a.href)
		last_toc_element_click_time.current = Date.now()
		scrollIntoView(h, {
			behavior: 'smooth', 
			block: 'start',
		}).then(() => 
			// sometimes it doesn't scroll to the right place
			// solution: try a second time!
			scrollIntoView(h, {
				behavior: 'smooth', 
				block: 'start',
			})
	   )
	}
	   
	// Remove any `id` attributes recursively, because they may interfere with linking-to-id using `#`
	const removeIdAttributes = (el) => {
		if (el && el.nodeType === 1) { // Element node
			if (el.hasAttribute?.("id")) el.removeAttribute?.("id")
			el.childNodes.forEach(removeIdAttributes)
		}
	}
	removeIdAttributes(a)

	// Remove Click-To-Copy-Header-ID feature
	a.querySelectorAll("pluto-header-id-copy-wrapper").forEach(el => el.remove())

	const row =  html`<div class="toc-row ${className} after-${last_level}">${a}</div>`
		intersection_observer_1.observe(title_el)
		intersection_observer_2.observe(title_el)
		header_to_index_entry_map.set(title_el, row)

	if(className.startsWith("H"))
		last_level = className
		
	return row
})}`
}

const invalidated = { current: false }

const updateCallback = () => {
	if (!invalidated.current) {
		tocNode.querySelector("section").replaceWith(
			html`<section>${render(getHeaders())}</section>`
		)
	}
}
updateCallback()
setTimeout(updateCallback, 100)
setTimeout(updateCallback, 1000)
setTimeout(updateCallback, 5000)

const notebook = document.querySelector("pluto-notebook")


// We have a mutationobserver for each cell:
const mut_observers = {
	current: [],
}

const createCellObservers = () => {
	mut_observers.current.forEach((o) => o.disconnect())
	mut_observers.current = Array.from(notebook.querySelectorAll("pluto-cell")).map(el => {
		const o = new MutationObserver(updateCallback)
		o.observe(el, {attributeFilter: ["class"]})
		return o
	})
}
createCellObservers()

// And one for the notebook's child list, which updates our cell observers:
const notebookObserver = new MutationObserver(() => {
	updateCallback()
	createCellObservers()
})
notebookObserver.observe(notebook, {childList: true})

// And finally, an observer for the document.body classList, to make sure that the toc also works when it is loaded during notebook initialization
const bodyClassObserver = new MutationObserver(updateCallback)
bodyClassObserver.observe(document.body, {attributeFilter: ["class"]})

// Hide/show the ToC when the screen gets small
let match_listener = () => {
	const small = (tocNode.closest("pluto-editor") ?? document.body).scrollWidth < 1000
	tocNode.classList.toggle("smallscreen", small)
	tocNode.classList.toggle("hide", small)
}
for(let s of [1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800, 1900, 2000]) {
	let m = matchMedia(`(max-width: ${s}px)`)
	m.addListener(match_listener)
	invalidation.then(() => m.removeListener(match_listener))
}
match_listener()

invalidation.then(() => {
	invalidated.current = true
	intersection_observer_1.disconnect()
	intersection_observer_2.disconnect()
	notebookObserver.disconnect()
	bodyClassObserver.disconnect()
	mut_observers.current.forEach((o) => o.disconnect())
	document.removeEventListener("click", document_click_handler)
})

return tocNode
</script>
<style>
@media not print {

.plutoui-toc {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Cantarell, "Apple Color Emoji",
		"Segoe UI Emoji", "Segoe UI Symbol", system-ui, sans-serif;
	--main-bg-color: #fafafa;
	--pluto-output-color: hsl(0, 0%, 36%);
	--pluto-output-h-color: hsl(0, 0%, 21%);
	--sidebar-li-active-bg: rgb(235, 235, 235);
	--icon-filter: unset;
}

@media (prefers-color-scheme: dark) {
	.plutoui-toc {
		--main-bg-color: #303030;
		--pluto-output-color: hsl(0, 0%, 90%);
		--pluto-output-h-color: hsl(0, 0%, 97%);
		--sidebar-li-active-bg: rgb(82, 82, 82);
		--icon-filter: invert(1);
	}
}

.plutoui-toc.aside {
	color: var(--pluto-output-color);
	position: fixed;
	right: 1rem;
	top: 5rem;
	width: min(80vw, 300px);
	padding: 0.5rem;
	padding-top: 0em;
	/* border: 3px solid rgba(0, 0, 0, 0.15); */
	border-radius: 10px;
	max-height: calc(100vh - 5rem - 90px);
	overflow: auto;
	z-index: 40;
	background-color: var(--main-bg-color);
	transition: transform 300ms cubic-bezier(0.18, 0.89, 0.45, 1.12);
}

.plutoui-toc.smallscreen:not(.hide) {
	box-shadow: 0 0 11px 0px #00000010;
}

.plutoui-toc.aside.hide {
	transform: translateX(calc(100% - 28px));
	color: transparent;
}
.plutoui-toc.aside.hide section {
	display: none;
}
.plutoui-toc.aside.hide header {
	margin-bottom: 0em;
	padding-bottom: 0em;
	border-bottom: none;
}
}  /* End of Media print query */
.plutoui-toc.aside.hide .open-toc,
.plutoui-toc.aside:not(.hide) .closed-toc,
.plutoui-toc:not(.aside) .closed-toc {
	display: none;
}

@media (prefers-reduced-motion) {
  .plutoui-toc.aside {
	transition-duration: 0s;
  }
}

.toc-toggle {
	cursor: pointer;
    padding: 1em;
    margin: -1em;
    margin-right: -0.7em;
    line-height: 1em;
    display: flex;
}

.toc-toggle::before {
    content: "";
    display: inline-block;
    height: 1em;
    width: 1em;
    background-image: url("https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/list-outline.svg");
	/* generated using https://dopiaza.org/tools/datauri/index.php */
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiI+PHRpdGxlPmlvbmljb25zLXY1LW88L3RpdGxlPjxsaW5lIHgxPSIxNjAiIHkxPSIxNDQiIHgyPSI0NDgiIHkyPSIxNDQiIHN0eWxlPSJmaWxsOm5vbmU7c3Ryb2tlOiMwMDA7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS13aWR0aDozMnB4Ii8+PGxpbmUgeDE9IjE2MCIgeTE9IjI1NiIgeDI9IjQ0OCIgeTI9IjI1NiIgc3R5bGU9ImZpbGw6bm9uZTtzdHJva2U6IzAwMDtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLXdpZHRoOjMycHgiLz48bGluZSB4MT0iMTYwIiB5MT0iMzY4IiB4Mj0iNDQ4IiB5Mj0iMzY4IiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojMDAwO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2Utd2lkdGg6MzJweCIvPjxjaXJjbGUgY3g9IjgwIiBjeT0iMTQ0IiByPSIxNiIgc3R5bGU9ImZpbGw6bm9uZTtzdHJva2U6IzAwMDtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7c3Ryb2tlLXdpZHRoOjMycHgiLz48Y2lyY2xlIGN4PSI4MCIgY3k9IjI1NiIgcj0iMTYiIHN0eWxlPSJmaWxsOm5vbmU7c3Ryb2tlOiMwMDA7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS13aWR0aDozMnB4Ii8+PGNpcmNsZSBjeD0iODAiIGN5PSIzNjgiIHI9IjE2IiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojMDAwO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2Utd2lkdGg6MzJweCIvPjwvc3ZnPg==");
    background-size: 1em;
	filter: var(--icon-filter);
}

.aside .toc-toggle.open-toc:hover::before {
    background-image: url("https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-forward-outline.svg");
	/* generated using https://dopiaza.org/tools/datauri/index.php */
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiI+PHRpdGxlPmlvbmljb25zLXY1LWE8L3RpdGxlPjxwb2x5bGluZSBwb2ludHM9IjI2OCAxMTIgNDEyIDI1NiAyNjggNDAwIiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojMDAwO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2Utd2lkdGg6NDhweCIvPjxsaW5lIHgxPSIzOTIiIHkxPSIyNTYiIHgyPSIxMDAiIHkyPSIyNTYiIHN0eWxlPSJmaWxsOm5vbmU7c3Ryb2tlOiMwMDA7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS13aWR0aDo0OHB4Ii8+PC9zdmc+");
}
.aside .toc-toggle.closed-toc:hover::before {
    background-image: url("https://cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-back-outline.svg");
	/* generated using https://dopiaza.org/tools/datauri/index.php */
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNTEyIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiI+PHRpdGxlPmlvbmljb25zLXY1LWE8L3RpdGxlPjxwb2x5bGluZSBwb2ludHM9IjI0NCA0MDAgMTAwIDI1NiAyNDQgMTEyIiBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojMDAwO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2Utd2lkdGg6NDhweCIvPjxsaW5lIHgxPSIxMjAiIHkxPSIyNTYiIHgyPSI0MTIiIHkyPSIyNTYiIHN0eWxlPSJmaWxsOm5vbmU7c3Ryb2tlOiMwMDA7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLWxpbmVqb2luOnJvdW5kO3N0cm9rZS13aWR0aDo0OHB4Ii8+PC9zdmc+");
}



.plutoui-toc header {
	display: flex;
	align-items: center;
	gap: .3em;
	font-size: 1.5em;
	/* margin-top: -0.1em; */
	margin-bottom: 0.4em;
	padding: 0.5rem;
	margin-left: 0;
	margin-right: 0;
	font-weight: bold;
	/* border-bottom: 2px solid rgba(0, 0, 0, 0.15); */
	position: sticky;
	top: 0px;
	background: var(--main-bg-color);
	z-index: 41;
}
.plutoui-toc.aside header {
	padding-left: 0;
	padding-right: 0;
}

.plutoui-toc section .toc-row {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: .1em;
	border-radius: .2em;
}

.plutoui-toc section .toc-row.H1 {
	margin-top: 1em;
}


.plutoui-toc.aside section .toc-row.in-view {
	background: var(--sidebar-li-active-bg);
}


	
.highlight-pluto-cell-shoulder {
	background: rgba(0, 0, 0, 0.05);
	background-clip: padding-box;
}

.plutoui-toc section a {
	text-decoration: none;
	font-weight: normal;
	color: var(--pluto-output-color);
}
.plutoui-toc section a:hover {
	color: var(--pluto-output-h-color);
}

.plutoui-toc.indent section a.H1 {
	font-weight: 700;
	line-height: 1em;
}

.plutoui-toc.indent section .after-H2 a { padding-left: 10px; }
.plutoui-toc.indent section .after-H3 a { padding-left: 20px; }
.plutoui-toc.indent section .after-H4 a { padding-left: 30px; }
.plutoui-toc.indent section .after-H5 a { padding-left: 40px; }
.plutoui-toc.indent section .after-H6 a { padding-left: 50px; }

.plutoui-toc.indent section a.H1 { padding-left: 0px; }
.plutoui-toc.indent section a.H2 { padding-left: 10px; }
.plutoui-toc.indent section a.H3 { padding-left: 20px; }
.plutoui-toc.indent section a.H4 { padding-left: 30px; }
.plutoui-toc.indent section a.H5 { padding-left: 40px; }
.plutoui-toc.indent section a.H6 { padding-left: 50px; }


.plutoui-toc.indent section a.pluto-docs-binding-el,
.plutoui-toc.indent section a.ASSIGNEE
	{
	font-family: JuliaMono, monospace;
	font-size: .8em;
	/* background: black; */
	font-weight: 700;
    font-style: italic;
	color: var(--cm-var-color); /* this is stealing a variable from Pluto, but it's fine if that doesnt work */
}
.plutoui-toc.indent section a.pluto-docs-binding-el::before,
.plutoui-toc.indent section a.ASSIGNEE::before
	{
	content: "> ";
	opacity: .3;
}
</style>
mimetext/htmlrootassigneelast_run_timestampA({SOpersist_js_state·has_pluto_hook_features§cell_id$57a8108f-9ad3-4cc2-9372-bb291fc3bf86depends_on_disabled_cells§runtime#published_object_keysdepends_on_skipped_cells§errored$50b34968-a45f-4c5b-a83d-7a5b47740007queued¤logsrunning¦outputbody<div class="markdown"><h4 id="Applying-the-update-step">Applying the update step</h4>
<p>The actual update step is handled automatically by Optimisers.jl. After implementing the &quot;internal&quot; functions <code>init</code> and <code>apply&#33;</code> to define a custom optimizer, we can use the &quot;public&quot; API:</p>
<ul>
<li><p><code>Optimisers.setup</code>: calls <code>init</code> to set up the optimizer</p>
</li>
<li><p><code>Optimisers.update</code>: calls <code>apply&#33;</code> to compute <code>new_grad</code> and <code>next_state</code> and performs the update step <code>params_new &#61; params - new_grad</code></p>
</li>
</ul>
</div>mimetext/htmlrootassigneelast_run_timestampA(<upersist_js_state·has_pluto_hook_features§cell_id$50b34968-a45f-4c5b-a83d-7a5b47740007depends_on_disabled_cells§runtime !published_object_keysdepends_on_skipped_cells§errored$06c0ad65-22d4-4c8e-ae19-4f05ba125e79queued¤logsrunning¦outputbodyٷ<div class="markdown"><h3 id="Initializing-packages">Initializing packages</h3>
<p><strong>Note:</strong> Running this notebook for the first time can take several minutes.</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(persist_js_state·has_pluto_hook_features§cell_id$06c0ad65-22d4-4c8e-ae19-4f05ba125e79depends_on_disabled_cells§runtime published_object_keysdepends_on_skipped_cells§errored$dcbf8963-4a5c-4e7d-81a9-3dce27fb3117queued¤logsrunning¦outputbodyj<div class="markdown"><p>Let&#39;s check whether the transformed data has <span class="tex">$\mu&#39;&#61;0$</span> and <span class="tex">$\sigma&#39;&#61;1$</span>.</p>
<p>Note that due to <a href="https://en.wikipedia.org/wiki/Machine_epsilon">rounding errors</a> arising from floating point arithmetic, the results will not be exactly zero and one:</p>
</div>mimetext/htmlrootassigneelast_run_timestampA(dpersist_js_state·has_pluto_hook_features§cell_id$dcbf8963-4a5c-4e7d-81a9-3dce27fb3117depends_on_disabled_cells§runtime Jpublished_object_keysdepends_on_skipped_cells§errored$5762be30-3084-4eda-9642-19dc9d4dcb10queued¤logsrunning¦outputbody<div class="markdown"><div class="admonition danger"><p class="admonition-title">Keep working on it!</p><p>Make sure that you define a struct called <code>GradientDescent</code>.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|hpersist_js_state·has_pluto_hook_features§cell_id$5762be30-3084-4eda-9642-19dc9d4dcb10depends_on_disabled_cells§runtime Bypublished_object_keysdepends_on_skipped_cells§errored$39063d08-d687-45a2-8367-734b12dcefeaqueued¤logsrunning¦outputbody<div class="markdown"><div class="admonition danger"><p class="admonition-title">Keep working on it!</p><p>Make sure that you define a struct called <code>Standardize</code>.</p>

</div>
</div>mimetext/htmlrootassigneelast_run_timestampA(|^persist_js_state·has_pluto_hook_features§cell_id$39063d08-d687-45a2-8367-734b12dcefeadepends_on_disabled_cells§runtime .published_object_keysdepends_on_skipped_cells§errored$582cf667-b85b-4a7d-bb17-88d4776fc240queued¤logsrunning¦outputbodymimetext/plainrootassigneelast_run_timestampA(zapersist_js_state·has_pluto_hook_features§cell_id$582cf667-b85b-4a7d-bb17-88d4776fc240depends_on_disabled_cells§runtime ǵpublished_object_keysdepends_on_skipped_cells§errored$d03e4e95-faab-4ab3-ab27-81189cbd8231queued¤logsrunning¦outputbodyelementsname"Mara Mustermann"text/plainemail""m.mustermann@campus.tu-berlin.de"text/plainid456123text/plaintypeNamedTupleobjectid8ccd0da495edb27bmime!application/vnd.pluto.tree+objectrootassigneestudentlast_run_timestampA(z̘)persist_js_state·has_pluto_hook_features§cell_id$d03e4e95-faab-4ab3-ab27-81189cbd8231depends_on_disabled_cells§runtimeCpublished_object_keysdepends_on_skipped_cells§errored$e0705a25-a01e-43a8-8c1d-ccf0da22fca7queued¤logsrunning¦outputbody<div class="markdown"><h4 id="Updating-the-optimizer">Updating the optimizer</h4>
<p>The function <code>apply&#33;</code> can do two things before the final update step is applied:</p>
<ol>
<li><p>it can modify the gradient</p>
</li>
<li><p>it can update the optimizer state</p>
</li>
</ol>
<pre><code class="language-julia">function Optimisers.apply&#33;&#40;alg::MyOptimiser, state, params, grad&#41;
  grad_new &#61; ... # some computation
  state_new &#61; ... # some computation
  return state_new, grad_new
end</code></pre>
</div>mimetext/htmlrootassigneelast_run_timestampA(mpersist_js_state·has_pluto_hook_features§cell_id$e0705a25-a01e-43a8-8c1d-ccf0da22fca7depends_on_disabled_cells§runtime Ypublished_object_keysdepends_on_skipped_cells§errored±cell_dependencies O$cf264b86-d86f-4c4a-af3b-03b34486e5ffprecedence_heuristic	cell_id$cf264b86-d86f-4c4a-af3b-03b34486e5ffdownstream_cells_mapupstream_cells_map@md_strgetindex$ac1355a2-db94-4954-ad65-6887b7dbb7adprecedence_heuristic	cell_id$ac1355a2-db94-4954-ad65-6887b7dbb7addownstream_cells_mapupstream_cells_maptransformed_data$f83196a4-a0fd-44a3-b3d1-29730599830dstd$3a100e93-7bba-4836-a4e6-e285aa6406c4precedence_heuristic	cell_id$3a100e93-7bba-4836-a4e6-e285aa6406c4downstream_cells_maptest_data$cf3c52c7-fc5e-4191-be9d-394660385801$f83196a4-a0fd-44a3-b3d1-29730599830d$a191392f-eb62-459d-8554-901d9db29950$78fcd02f-1a6e-4799-b042-4542a1ec7847upstream_cells_map$80c5a262-e758-4075-896f-a0bc7ce1534cprecedence_heuristic	cell_id$80c5a262-e758-4075-896f-a0bc7ce1534cdownstream_cells_mapupstream_cells_map@md_strgetindex$8b519a7d-b64f-4c0c-8d74-17a963cb381dprecedence_heuristic	cell_id$8b519a7d-b64f-4c0c-8d74-17a963cb381ddownstream_cells_mapupstream_cells_map@md_strtipgetindex$0fbd2560-1e4c-45b7-89a6-d2b622f9f907precedence_heuristic	cell_id$0fbd2560-1e4c-45b7-89a6-d2b622f9f907downstream_cells_mapplot_loss_surface$cd7c244d-8a4c-4aaf-ad4b-891744e004be$a3634333-1149-4392-a7e9-350a56d67d2bupstream_cells_mapP2$3b65f124-75c2-4fb3-8b59-94015500acbfP1$3b65f124-75c2-4fb3-8b59-94015500acbfloss$3bb76227-82cd-4924-bfb3-1b8504e2dc44contour$ff5d316f-806c-4652-97d8-323462395c69precedence_heuristic	cell_id$ff5d316f-806c-4652-97d8-323462395c69downstream_cells_mapupstream_cells_map@md_strstudent$d03e4e95-faab-4ab3-ab27-81189cbd8231getindex$e5e014e6-e24d-4de0-a216-61c0f9d9c331precedence_heuristic	cell_id$e5e014e6-e24d-4de0-a216-61c0f9d9c331downstream_cells_mapupstream_cells_maptypeofdt$cf3c52c7-fc5e-4191-be9d-394660385801$02a62f7b-6014-439a-a254-49f53f204abbprecedence_heuristic	cell_id$02a62f7b-6014-439a-a254-49f53f204abbdownstream_cells_mapupstream_cells_map@md_strgetindex$bcdd297b-c52c-4076-9329-929d69b8021bprecedence_heuristic	cell_id$bcdd297b-c52c-4076-9329-929d69b8021bdownstream_cells_mapupstream_cells_map@md_strgetindex$3f81ccce-5744-42ba-aa1e-b3da6212b9efprecedence_heuristic	cell_id$3f81ccce-5744-42ba-aa1e-b3da6212b9efdownstream_cells_mapupstream_cells_mapoptimizers$ed873ea2-d4bd-46e7-b89b-4e5494b606e6plot_trajectory$a3634333-1149-4392-a7e9-350a56d67d2b$a3634333-1149-4392-a7e9-350a56d67d2bprecedence_heuristic	cell_id$a3634333-1149-4392-a7e9-350a56d67d2bdownstream_cells_mapplot_trajectory$3f81ccce-5744-42ba-aa1e-b3da6212b9efupstream_cells_map:Zygote.gradientOptimisers.updateOptimisers$582cf667-b85b-4a7d-bb17-88d4776fc240loss$3bb76227-82cd-4924-bfb3-1b8504e2dc44similarZygote$755b8685-0711-48a2-a3eb-f80af39f10e1plot_loss_surface$0fbd2560-1e4c-45b7-89a6-d2b622f9f907Optimisers.setup+plot!$be2c5285-fbd8-4c37-8b17-db6db95c8a4eprecedence_heuristic	cell_id$be2c5285-fbd8-4c37-8b17-db6db95c8a4edownstream_cells_mapupstream_cells_map@md_strtask$5061a130-fc0a-4306-bdf5-6966e8de938agetindex$ef9a0669-2d02-4f1b-aa99-6f6473d37c0fprecedence_heuristic	cell_id$ef9a0669-2d02-4f1b-aa99-6f6473d37c0fdownstream_cells_mapupstream_cells_map@md_strtask$5061a130-fc0a-4306-bdf5-6966e8de938agetindex$aaea0bbf-868d-4fe0-b348-307449d06517precedence_heuristic	cell_id$aaea0bbf-868d-4fe0-b348-307449d06517downstream_cells_mapupstream_cells_map$c080e799-b5c5-42cf-b5f1-8c36da89fc8fprecedence_heuristic	cell_id$c080e799-b5c5-42cf-b5f1-8c36da89fc8fdownstream_cells_mapupstream_cells_map@md_strgetindex$569173af-9e54-49cb-b1cb-88b8cbda57a6precedence_heuristic	cell_id$569173af-9e54-49cb-b1cb-88b8cbda57a6downstream_cells_mapupstream_cells_map@md_strgetindex$f60be2e0-9b43-46b5-96ef-7747ab56e164precedence_heuristic	cell_id$f60be2e0-9b43-46b5-96ef-7747ab56e164downstream_cells_mapfeedbackupstream_cells_map$dc35d701-ab40-4933-b4c5-35a81b3f834aprecedence_heuristic	cell_id$dc35d701-ab40-4933-b4c5-35a81b3f834adownstream_cells_maplr1$ed873ea2-d4bd-46e7-b89b-4e5494b606e6upstream_cells_mapCoreBase:PlutoRunner.create_bondPlutoRunnerCore.applicable@bindBase.getSlider$a96abf48-cacf-41f8-bb7a-3d085bdb0a62precedence_heuristic	cell_id$a96abf48-cacf-41f8-bb7a-3d085bdb0a62downstream_cells_mapupstream_cells_map@md_strgetindex$58a671a1-3059-4fa9-b758-f3a76a573aa5precedence_heuristic	cell_id$58a671a1-3059-4fa9-b758-f3a76a573aa5downstream_cells_mapupstream_cells_map$4eac0e3f-7212-4038-a24e-8d6ca3fbe659precedence_heuristic	cell_id$4eac0e3f-7212-4038-a24e-8d6ca3fbe659downstream_cells_mapupstream_cells_map @md_strBase.getindex≈Nothing!Tuplehasmethod@isdefinedFloat64ismissingGradientDescentOptimisers$582cf667-b85b-4a7d-bb17-88d4776fc240nothingstill_missingVectorBasecorrectkeep_workingOptimisers.apply!isnothing$3d638561-6760-4260-991a-b0b0c77745a3precedence_heuristiccell_id$3d638561-6760-4260-991a-b0b0c77745a3downstream_cells_mapStatisticsupstream_cells_map$17ff11e9-84f8-4911-845b-930a53c73e0eprecedence_heuristic	cell_id$17ff11e9-84f8-4911-845b-930a53c73e0edownstream_cells_mapupstream_cells_mapdt$cf3c52c7-fc5e-4191-be9d-394660385801$3ac8faba-1af9-4fc6-a1d0-37225b9ebb02precedence_heuristic	cell_id$3ac8faba-1af9-4fc6-a1d0-37225b9ebb02downstream_cells_mapupstream_cells_map@md_strgetindex$bb0d58f9-380e-43fa-9524-0108a2816884precedence_heuristic	cell_id$bb0d58f9-380e-43fa-9524-0108a2816884downstream_cells_maptransform$f83196a4-a0fd-44a3-b3d1-29730599830d$39063d08-d687-45a2-8367-734b12dcefea$7de85c6f-996a-4d5b-8236-271922aeb908upstream_cells_mapmissingStandardize$5061a130-fc0a-4306-bdf5-6966e8de938aprecedence_heuristic	cell_id$5061a130-fc0a-4306-bdf5-6966e8de938adownstream_cells_maptask$8ece9aea-20f5-41db-95ca-08c8d4d2d4c1$2258b8c6-e8b7-4c06-9ece-53b254db6a2c$be2c5285-fbd8-4c37-8b17-db6db95c8a4e$ef9a0669-2d02-4f1b-aa99-6f6473d37c0f$b0d679ba-13f8-4e70-ac42-68acb2ff83d1$bebbf87b-cd7b-43d7-8025-938fc4c6944dmd_parseupstream_cells_mapMarkdown.parseMarkdown.AdmonitionMarkdown.MD*Markdown==$ddd6e83e-5a0d-4ff0-afe4-dedfc860994cprecedence_heuristic	cell_id$ddd6e83e-5a0d-4ff0-afe4-dedfc860994cdownstream_cells_mapupstream_cells_map@md_strgetindex$f9192279-9d12-485e-bb9d-650be2dbd878precedence_heuristic	cell_id$f9192279-9d12-485e-bb9d-650be2dbd878downstream_cells_maplr2$ed873ea2-d4bd-46e7-b89b-4e5494b606e6upstream_cells_mapCoreBase:PlutoRunner.create_bondPlutoRunnerCore.applicable@bindBase.getSlider$78fcd02f-1a6e-4799-b042-4542a1ec7847precedence_heuristic	cell_id$78fcd02f-1a6e-4799-b042-4542a1ec7847downstream_cells_mapupstream_cells_maptest_data$3a100e93-7bba-4836-a4e6-e285aa6406c4plot_standardization$7de85c6f-996a-4d5b-8236-271922aeb908dt$cf3c52c7-fc5e-4191-be9d-394660385801$2341dd4a-a35a-4a62-815a-e972d04844abprecedence_heuristic	cell_id$2341dd4a-a35a-4a62-815a-e972d04844abdownstream_cells_mapupstream_cells_map@md_strgetindex$d36914f8-f7d4-407a-a842-436f4035157bprecedence_heuristic	cell_id$d36914f8-f7d4-407a-a842-436f4035157bdownstream_cells_mapupstream_cells_map@md_strgetindex$3b65f124-75c2-4fb3-8b59-94015500acbfprecedence_heuristic	cell_id$3b65f124-75c2-4fb3-8b59-94015500acbfdownstream_cells_mapP2$0fbd2560-1e4c-45b7-89a6-d2b622f9f907P1$0fbd2560-1e4c-45b7-89a6-d2b622f9f907upstream_cells_maprange$755b8685-0711-48a2-a3eb-f80af39f10e1precedence_heuristiccell_id$755b8685-0711-48a2-a3eb-f80af39f10e1downstream_cells_mapZygote$a3634333-1149-4392-a7e9-350a56d67d2bPlotlyKaleidoPlutoUIPlotsPlotlyBaseLaTeXStringsPlutoTeachingToolsupstream_cells_mapplotly$3bb76227-82cd-4924-bfb3-1b8504e2dc44precedence_heuristic	cell_id$3bb76227-82cd-4924-bfb3-1b8504e2dc44downstream_cells_maploss$0fbd2560-1e4c-45b7-89a6-d2b622f9f907$a3634333-1149-4392-a7e9-350a56d67d2bupstream_cells_map-^+*$5dc7d04d-f6a5-4265-b890-d74ea4b3c602precedence_heuristic	cell_id$5dc7d04d-f6a5-4265-b890-d74ea4b3c602downstream_cells_mapupstream_cells_map$fd30da51-0890-4ebe-8b14-8975ec12fec0precedence_heuristic	cell_id$fd30da51-0890-4ebe-8b14-8975ec12fec0downstream_cells_mapupstream_cells_map @md_strBase.getindex≈!Tuplehasmethod@isdefinedismissingstill_missingVectorBasecorrectkeep_workingIntStandardizeisnothinghasfield$8ece9aea-20f5-41db-95ca-08c8d4d2d4c1precedence_heuristic	cell_id$8ece9aea-20f5-41db-95ca-08c8d4d2d4c1downstream_cells_mapupstream_cells_maptask$5061a130-fc0a-4306-bdf5-6966e8de938a$b0d679ba-13f8-4e70-ac42-68acb2ff83d1precedence_heuristic	cell_id$b0d679ba-13f8-4e70-ac42-68acb2ff83d1downstream_cells_mapupstream_cells_map@md_strtask$5061a130-fc0a-4306-bdf5-6966e8de938agetindex$f83196a4-a0fd-44a3-b3d1-29730599830dprecedence_heuristic	cell_id$f83196a4-a0fd-44a3-b3d1-29730599830ddownstream_cells_maptransformed_data$2cd9cef0-d746-411a-861f-b8a035f4a1d3$ac1355a2-db94-4954-ad65-6887b7dbb7ad$a191392f-eb62-459d-8554-901d9db29950upstream_cells_maptest_data$3a100e93-7bba-4836-a4e6-e285aa6406c4dt$cf3c52c7-fc5e-4191-be9d-394660385801transform$bb0d58f9-380e-43fa-9524-0108a2816884$6d5bf1e5-5ab0-4351-89d0-ddb6fcfa27b6precedence_heuristic	cell_id$6d5bf1e5-5ab0-4351-89d0-ddb6fcfa27b6downstream_cells_mapupstream_cells_map@md_strBase.getindex≈!Tuplehasmethod@isdefinedFloat64GradientDescentBasecorrectkeep_workinghasfield$822d03c6-48f8-47b0-8f25-b2de45e4c589precedence_heuristic	cell_id$822d03c6-48f8-47b0-8f25-b2de45e4c589downstream_cells_mapupstream_cells_map@md_strMarkdown.AdmonitionMarkdown.MDMarkdowngetindex$bebbf87b-cd7b-43d7-8025-938fc4c6944dprecedence_heuristic	cell_id$bebbf87b-cd7b-43d7-8025-938fc4c6944ddownstream_cells_mapupstream_cells_map@md_strtask$5061a130-fc0a-4306-bdf5-6966e8de938agetindex$c2adc38f-84e3-486f-93d8-b88eea63a09bprecedence_heuristic	cell_id$c2adc38f-84e3-486f-93d8-b88eea63a09bdownstream_cells_mapupstream_cells_map@md_strgetindex$5370c50b-a9b8-41dc-8cfe-1f0389df97c3precedence_heuristic	cell_id$5370c50b-a9b8-41dc-8cfe-1f0389df97c3downstream_cells_mapupstream_cells_map@md_strgetindex$32e8ee04-4378-4377-ae47-b65e5ce70667precedence_heuristic	cell_id$32e8ee04-4378-4377-ae47-b65e5ce70667downstream_cells_mapupstream_cells_map@md_strgetindex$befba318-8595-4fc4-b42e-9c9125e7abfbprecedence_heuristic	cell_id$befba318-8595-4fc4-b42e-9c9125e7abfbdownstream_cells_mapupstream_cells_map@md_strtipgetindex$d5052369-0b47-42e7-b661-058c7365c032precedence_heuristic	cell_id$d5052369-0b47-42e7-b661-058c7365c032downstream_cells_mapupstream_cells_map@md_strtipgetindex$cf3c52c7-fc5e-4191-be9d-394660385801precedence_heuristic	cell_id$cf3c52c7-fc5e-4191-be9d-394660385801downstream_cells_mapdt$e5e014e6-e24d-4de0-a216-61c0f9d9c331$17ff11e9-84f8-4911-845b-930a53c73e0e$955a9751-38d0-4327-9a95-a0523c2d54b8$f83196a4-a0fd-44a3-b3d1-29730599830d$a191392f-eb62-459d-8554-901d9db29950$78fcd02f-1a6e-4799-b042-4542a1ec7847upstream_cells_maptest_data$3a100e93-7bba-4836-a4e6-e285aa6406c4Standardize$2cd9cef0-d746-411a-861f-b8a035f4a1d3precedence_heuristic	cell_id$2cd9cef0-d746-411a-861f-b8a035f4a1d3downstream_cells_mapupstream_cells_maptransformed_data$f83196a4-a0fd-44a3-b3d1-29730599830dmean$d15eb189-6e4d-4c70-a1cb-159e6a4eb8ebprecedence_heuristic	cell_id$d15eb189-6e4d-4c70-a1cb-159e6a4eb8ebdownstream_cells_mapupstream_cells_map@md_strtipgetindex$955a9751-38d0-4327-9a95-a0523c2d54b8precedence_heuristic	cell_id$955a9751-38d0-4327-9a95-a0523c2d54b8downstream_cells_mapupstream_cells_mapdt$cf3c52c7-fc5e-4191-be9d-394660385801$62a1289b-ce6a-444d-8b20-92bd4fa3d05dprecedence_heuristic	cell_id$62a1289b-ce6a-444d-8b20-92bd4fa3d05ddownstream_cells_mapupstream_cells_map@md_strgetindex$221fd504-4cd6-4bab-b2a5-a590fff26a52precedence_heuristic	cell_id$221fd504-4cd6-4bab-b2a5-a590fff26a52downstream_cells_mapinverse_transform$a191392f-eb62-459d-8554-901d9db29950$39063d08-d687-45a2-8367-734b12dcefeaupstream_cells_mapmissingStandardize$a191392f-eb62-459d-8554-901d9db29950precedence_heuristic	cell_id$a191392f-eb62-459d-8554-901d9db29950downstream_cells_mapupstream_cells_map≈test_data$3a100e93-7bba-4836-a4e6-e285aa6406c4inverse_transform$221fd504-4cd6-4bab-b2a5-a590fff26a52transformed_data$f83196a4-a0fd-44a3-b3d1-29730599830ddt$cf3c52c7-fc5e-4191-be9d-394660385801$67d7c60c-1c5e-4760-a9e1-4538e2ccc10eprecedence_heuristic	cell_id$67d7c60c-1c5e-4760-a9e1-4538e2ccc10edownstream_cells_mapupstream_cells_map@md_strgetindex$d16b1a65-5da9-46ac-b0b8-59e55ced37f3precedence_heuristic	cell_id$d16b1a65-5da9-46ac-b0b8-59e55ced37f3downstream_cells_mapupstream_cells_map@md_strgetindex$7de85c6f-996a-4d5b-8236-271922aeb908precedence_heuristic	cell_id$7de85c6f-996a-4d5b-8236-271922aeb908downstream_cells_mapplot_standardization$78fcd02f-1a6e-4799-b042-4542a1ec7847upstream_cells_maphistogramexphistogram!^/πplot!*Standardizetransform$bb0d58f9-380e-43fa-9524-0108a2816884$edb7814a-eddf-4c87-8857-19bb0a0c0241precedence_heuristic	cell_id$edb7814a-eddf-4c87-8857-19bb0a0c0241downstream_cells_mapupstream_cells_map@md_strgetindex$2258b8c6-e8b7-4c06-9ece-53b254db6a2cprecedence_heuristic	cell_id$2258b8c6-e8b7-4c06-9ece-53b254db6a2cdownstream_cells_mapupstream_cells_map@md_strtask$5061a130-fc0a-4306-bdf5-6966e8de938agetindex$8e8d9f57-0f04-4a91-b69f-273fe1fafd61precedence_heuristic	cell_id$8e8d9f57-0f04-4a91-b69f-273fe1fafd61downstream_cells_mapupstream_cells_mapBaseBase.Docs.HTML@html_str$f7347c06-c1b7-11ed-3b8e-fbf167ce9cbaprecedence_heuristic	cell_id$f7347c06-c1b7-11ed-3b8e-fbf167ce9cbadownstream_cells_mapupstream_cells_mapBaseBase.Docs.HTML@html_str$c322fd53-78db-40ae-b7ba-612200ab6617precedence_heuristic	cell_id$c322fd53-78db-40ae-b7ba-612200ab6617downstream_cells_mapupstream_cells_map@md_strgetindex$dc4f7f55-dde5-4ee6-b43d-7f64269b55d1precedence_heuristic	cell_id$dc4f7f55-dde5-4ee6-b43d-7f64269b55d1downstream_cells_mapupstream_cells_map$cd7c244d-8a4c-4aaf-ad4b-891744e004beprecedence_heuristic	cell_id$cd7c244d-8a4c-4aaf-ad4b-891744e004bedownstream_cells_mapupstream_cells_mapplot_loss_surface$0fbd2560-1e4c-45b7-89a6-d2b622f9f907$ed873ea2-d4bd-46e7-b89b-4e5494b606e6precedence_heuristic	cell_id$ed873ea2-d4bd-46e7-b89b-4e5494b606e6downstream_cells_mapoptimizers$3f81ccce-5744-42ba-aa1e-b3da6212b9efupstream_cells_mapDictADAMGradientDescentMomentum=>lr1$dc35d701-ab40-4933-b4c5-35a81b3f834alr2$f9192279-9d12-485e-bb9d-650be2dbd878$b3832fb6-dd19-4b38-8117-b0a11d1bc34fprecedence_heuristic	cell_id$b3832fb6-dd19-4b38-8117-b0a11d1bc34fdownstream_cells_mapupstream_cells_map@md_strgetindex$bdcb27c5-0603-49ac-b831-d78c558b31f0precedence_heuristic	cell_id$bdcb27c5-0603-49ac-b831-d78c558b31f0downstream_cells_mapupstream_cells_map@md_strgetindex$33866006-11d7-46cc-870b-fec519a2b541precedence_heuristic	cell_id$33866006-11d7-46cc-870b-fec519a2b541downstream_cells_mapupstream_cells_map@md_strtipgetindex$44ec9e94-f6af-431e-8841-bae44431dfa3precedence_heuristic	cell_id$44ec9e94-f6af-431e-8841-bae44431dfa3downstream_cells_mapupstream_cells_map@md_strisacorrectstill_missing!student$d03e4e95-faab-4ab3-ab27-81189cbd8231==Numbergetindex$57a8108f-9ad3-4cc2-9372-bb291fc3bf86precedence_heuristic	cell_id$57a8108f-9ad3-4cc2-9372-bb291fc3bf86downstream_cells_mapupstream_cells_mapTableOfContents$50b34968-a45f-4c5b-a83d-7a5b47740007precedence_heuristic	cell_id$50b34968-a45f-4c5b-a83d-7a5b47740007downstream_cells_mapupstream_cells_map@md_strgetindex$06c0ad65-22d4-4c8e-ae19-4f05ba125e79precedence_heuristic	cell_id$06c0ad65-22d4-4c8e-ae19-4f05ba125e79downstream_cells_mapupstream_cells_map@md_strgetindex$dcbf8963-4a5c-4e7d-81a9-3dce27fb3117precedence_heuristic	cell_id$dcbf8963-4a5c-4e7d-81a9-3dce27fb3117downstream_cells_mapupstream_cells_map@md_strgetindex$5762be30-3084-4eda-9642-19dc9d4dcb10precedence_heuristic	cell_id$5762be30-3084-4eda-9642-19dc9d4dcb10downstream_cells_mapupstream_cells_map@md_strBase.getindex!Tuplehasmethod@isdefinedOptimisers.initFloat64GradientDescentOptimisers$582cf667-b85b-4a7d-bb17-88d4776fc240VectorBasecorrectkeep_workingisnothing$39063d08-d687-45a2-8367-734b12dcefeaprecedence_heuristic	cell_id$39063d08-d687-45a2-8367-734b12dcefeadownstream_cells_mapupstream_cells_map@md_strBase.getindexinverse_transform$221fd504-4cd6-4bab-b2a5-a590fff26a52≈!@isdefinedismissingstill_missingBasecorrectkeep_workingnot_definedStandardizetransform$bb0d58f9-380e-43fa-9524-0108a2816884isnothing$582cf667-b85b-4a7d-bb17-88d4776fc240precedence_heuristiccell_id$582cf667-b85b-4a7d-bb17-88d4776fc240downstream_cells_mapOptimisers$5762be30-3084-4eda-9642-19dc9d4dcb10$4eac0e3f-7212-4038-a24e-8d6ca3fbe659$a3634333-1149-4392-a7e9-350a56d67d2bupstream_cells_map$d03e4e95-faab-4ab3-ab27-81189cbd8231precedence_heuristic	cell_id$d03e4e95-faab-4ab3-ab27-81189cbd8231downstream_cells_mapstudent$ff5d316f-806c-4652-97d8-323462395c69$44ec9e94-f6af-431e-8841-bae44431dfa3upstream_cells_map$e0705a25-a01e-43a8-8c1d-ccf0da22fca7precedence_heuristic	cell_id$e0705a25-a01e-43a8-8c1d-ccf0da22fca7downstream_cells_mapupstream_cells_map@md_strgetindexcell_execution_order O$755b8685-0711-48a2-a3eb-f80af39f10e1$3d638561-6760-4260-991a-b0b0c77745a3$582cf667-b85b-4a7d-bb17-88d4776fc240$8e8d9f57-0f04-4a91-b69f-273fe1fafd61$f7347c06-c1b7-11ed-3b8e-fbf167ce9cba$bdcb27c5-0603-49ac-b831-d78c558b31f0$ddd6e83e-5a0d-4ff0-afe4-dedfc860994c$d03e4e95-faab-4ab3-ab27-81189cbd8231$ff5d316f-806c-4652-97d8-323462395c69$44ec9e94-f6af-431e-8841-bae44431dfa3$06c0ad65-22d4-4c8e-ae19-4f05ba125e79$57a8108f-9ad3-4cc2-9372-bb291fc3bf86$5061a130-fc0a-4306-bdf5-6966e8de938a$8ece9aea-20f5-41db-95ca-08c8d4d2d4c1$d36914f8-f7d4-407a-a842-436f4035157b$3a100e93-7bba-4836-a4e6-e285aa6406c4$8b519a7d-b64f-4c0c-8d74-17a963cb381d$02a62f7b-6014-439a-a254-49f53f204abb$2258b8c6-e8b7-4c06-9ece-53b254db6a2c$aaea0bbf-868d-4fe0-b348-307449d06517$80c5a262-e758-4075-896f-a0bc7ce1534c$cf3c52c7-fc5e-4191-be9d-394660385801$e5e014e6-e24d-4de0-a216-61c0f9d9c331$17ff11e9-84f8-4911-845b-930a53c73e0e$955a9751-38d0-4327-9a95-a0523c2d54b8$fd30da51-0890-4ebe-8b14-8975ec12fec0$c2adc38f-84e3-486f-93d8-b88eea63a09b$be2c5285-fbd8-4c37-8b17-db6db95c8a4e$bb0d58f9-380e-43fa-9524-0108a2816884$221fd504-4cd6-4bab-b2a5-a590fff26a52$dcbf8963-4a5c-4e7d-81a9-3dce27fb3117$f83196a4-a0fd-44a3-b3d1-29730599830d$2cd9cef0-d746-411a-861f-b8a035f4a1d3$ac1355a2-db94-4954-ad65-6887b7dbb7ad$569173af-9e54-49cb-b1cb-88b8cbda57a6$a191392f-eb62-459d-8554-901d9db29950$39063d08-d687-45a2-8367-734b12dcefea$bcdd297b-c52c-4076-9329-929d69b8021b$7de85c6f-996a-4d5b-8236-271922aeb908$78fcd02f-1a6e-4799-b042-4542a1ec7847$3ac8faba-1af9-4fc6-a1d0-37225b9ebb02$33866006-11d7-46cc-870b-fec519a2b541$c322fd53-78db-40ae-b7ba-612200ab6617$b3832fb6-dd19-4b38-8117-b0a11d1bc34f$67d7c60c-1c5e-4760-a9e1-4538e2ccc10e$befba318-8595-4fc4-b42e-9c9125e7abfb$e0705a25-a01e-43a8-8c1d-ccf0da22fca7$d5052369-0b47-42e7-b661-058c7365c032$50b34968-a45f-4c5b-a83d-7a5b47740007$d16b1a65-5da9-46ac-b0b8-59e55ced37f3$ef9a0669-2d02-4f1b-aa99-6f6473d37c0f$58a671a1-3059-4fa9-b758-f3a76a573aa5$6d5bf1e5-5ab0-4351-89d0-ddb6fcfa27b6$32e8ee04-4378-4377-ae47-b65e5ce70667$b0d679ba-13f8-4e70-ac42-68acb2ff83d1$5dc7d04d-f6a5-4265-b890-d74ea4b3c602$5762be30-3084-4eda-9642-19dc9d4dcb10$c080e799-b5c5-42cf-b5f1-8c36da89fc8f$bebbf87b-cd7b-43d7-8025-938fc4c6944d$dc4f7f55-dde5-4ee6-b43d-7f64269b55d1$4eac0e3f-7212-4038-a24e-8d6ca3fbe659$cf264b86-d86f-4c4a-af3b-03b34486e5ff$3bb76227-82cd-4924-bfb3-1b8504e2dc44$62a1289b-ce6a-444d-8b20-92bd4fa3d05d$3b65f124-75c2-4fb3-8b59-94015500acbf$0fbd2560-1e4c-45b7-89a6-d2b622f9f907$cd7c244d-8a4c-4aaf-ad4b-891744e004be$2341dd4a-a35a-4a62-815a-e972d04844ab$dc35d701-ab40-4933-b4c5-35a81b3f834a$f9192279-9d12-485e-bb9d-650be2dbd878$ed873ea2-d4bd-46e7-b89b-4e5494b606e6$a96abf48-cacf-41f8-bb7a-3d085bdb0a62$a3634333-1149-4392-a7e9-350a56d67d2b$3f81ccce-5744-42ba-aa1e-b3da6212b9ef$d15eb189-6e4d-4c70-a1cb-159e6a4eb8eb$5370c50b-a9b8-41dc-8cfe-1f0389df97c3$822d03c6-48f8-47b0-8f25-b2de45e4c589$edb7814a-eddf-4c87-8857-19bb0a0c0241$f60be2e0-9b43-46b5-96ef-7747ab56e164last_hot_reload_time        shortpathH3_Custom_Types.jlprocess_statusreadypathM/home/runner/work/julia-ml-course/julia-ml-course/homework/H3_Custom_Types.jlpluto_versionv0.20.24last_save_timeA(&cell_order O$8e8d9f57-0f04-4a91-b69f-273fe1fafd61$ff5d316f-806c-4652-97d8-323462395c69$f7347c06-c1b7-11ed-3b8e-fbf167ce9cba$bdcb27c5-0603-49ac-b831-d78c558b31f0$ddd6e83e-5a0d-4ff0-afe4-dedfc860994c$8ece9aea-20f5-41db-95ca-08c8d4d2d4c1$d03e4e95-faab-4ab3-ab27-81189cbd8231$44ec9e94-f6af-431e-8841-bae44431dfa3$06c0ad65-22d4-4c8e-ae19-4f05ba125e79$755b8685-0711-48a2-a3eb-f80af39f10e1$57a8108f-9ad3-4cc2-9372-bb291fc3bf86$5061a130-fc0a-4306-bdf5-6966e8de938a$d36914f8-f7d4-407a-a842-436f4035157b$3a100e93-7bba-4836-a4e6-e285aa6406c4$8b519a7d-b64f-4c0c-8d74-17a963cb381d$02a62f7b-6014-439a-a254-49f53f204abb$2258b8c6-e8b7-4c06-9ece-53b254db6a2c$3d638561-6760-4260-991a-b0b0c77745a3$aaea0bbf-868d-4fe0-b348-307449d06517$80c5a262-e758-4075-896f-a0bc7ce1534c$cf3c52c7-fc5e-4191-be9d-394660385801$e5e014e6-e24d-4de0-a216-61c0f9d9c331$17ff11e9-84f8-4911-845b-930a53c73e0e$955a9751-38d0-4327-9a95-a0523c2d54b8$fd30da51-0890-4ebe-8b14-8975ec12fec0$c2adc38f-84e3-486f-93d8-b88eea63a09b$be2c5285-fbd8-4c37-8b17-db6db95c8a4e$bb0d58f9-380e-43fa-9524-0108a2816884$221fd504-4cd6-4bab-b2a5-a590fff26a52$dcbf8963-4a5c-4e7d-81a9-3dce27fb3117$f83196a4-a0fd-44a3-b3d1-29730599830d$2cd9cef0-d746-411a-861f-b8a035f4a1d3$ac1355a2-db94-4954-ad65-6887b7dbb7ad$569173af-9e54-49cb-b1cb-88b8cbda57a6$a191392f-eb62-459d-8554-901d9db29950$39063d08-d687-45a2-8367-734b12dcefea$bcdd297b-c52c-4076-9329-929d69b8021b$78fcd02f-1a6e-4799-b042-4542a1ec7847$7de85c6f-996a-4d5b-8236-271922aeb908$3ac8faba-1af9-4fc6-a1d0-37225b9ebb02$582cf667-b85b-4a7d-bb17-88d4776fc240$33866006-11d7-46cc-870b-fec519a2b541$c322fd53-78db-40ae-b7ba-612200ab6617$b3832fb6-dd19-4b38-8117-b0a11d1bc34f$67d7c60c-1c5e-4760-a9e1-4538e2ccc10e$befba318-8595-4fc4-b42e-9c9125e7abfb$e0705a25-a01e-43a8-8c1d-ccf0da22fca7$d5052369-0b47-42e7-b661-058c7365c032$50b34968-a45f-4c5b-a83d-7a5b47740007$d16b1a65-5da9-46ac-b0b8-59e55ced37f3$ef9a0669-2d02-4f1b-aa99-6f6473d37c0f$58a671a1-3059-4fa9-b758-f3a76a573aa5$6d5bf1e5-5ab0-4351-89d0-ddb6fcfa27b6$32e8ee04-4378-4377-ae47-b65e5ce70667$b0d679ba-13f8-4e70-ac42-68acb2ff83d1$5dc7d04d-f6a5-4265-b890-d74ea4b3c602$5762be30-3084-4eda-9642-19dc9d4dcb10$c080e799-b5c5-42cf-b5f1-8c36da89fc8f$bebbf87b-cd7b-43d7-8025-938fc4c6944d$dc4f7f55-dde5-4ee6-b43d-7f64269b55d1$4eac0e3f-7212-4038-a24e-8d6ca3fbe659$cf264b86-d86f-4c4a-af3b-03b34486e5ff$3bb76227-82cd-4924-bfb3-1b8504e2dc44$62a1289b-ce6a-444d-8b20-92bd4fa3d05d$3b65f124-75c2-4fb3-8b59-94015500acbf$cd7c244d-8a4c-4aaf-ad4b-891744e004be$0fbd2560-1e4c-45b7-89a6-d2b622f9f907$2341dd4a-a35a-4a62-815a-e972d04844ab$dc35d701-ab40-4933-b4c5-35a81b3f834a$f9192279-9d12-485e-bb9d-650be2dbd878$ed873ea2-d4bd-46e7-b89b-4e5494b606e6$3f81ccce-5744-42ba-aa1e-b3da6212b9ef$a96abf48-cacf-41f8-bb7a-3d085bdb0a62$a3634333-1149-4392-a7e9-350a56d67d2b$d15eb189-6e4d-4c70-a1cb-159e6a4eb8eb$5370c50b-a9b8-41dc-8cfe-1f0389df97c3$822d03c6-48f8-47b0-8f25-b2de45e4c589$edb7814a-eddf-4c87-8857-19bb0a0c0241$f60be2e0-9b43-46b5-96ef-7747ab56e164published_objectsnbpkginstall_time_ns   instantiatedòinstalled_versionsStatisticsstdlibZygote0.7.10PlotlyKaleido2.3.1PlotlyBase0.8.23Plots1.41.6PlutoUI0.7.80LaTeXStrings1.4.0Optimisers0.4.7PlutoTeachingTools0.4.7terminal_outputsStatistics
[0m[1mWaiting for other notebooks to finish Pkg operations...[22m
[90m===[39m

[0m[1mResolving...[22m
[90m===[39m
[33m[1m┌ [22m[39m[33m[1mWarning: [22m[39mPkg operation failed. Fixing stdlib dependencies and trying again...
[33m[1m└ [22m[39m[90m@ GracefulPkg ~/.julia/packages/GracefulPkg/GQ6My/src/apply strategies.jl:96[39m

[0m[1mResolving...[22m
[90m===[39m
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Project.toml`
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Manifest.toml`

[0m[1mInstantiating...[22m
[90m===[39m

[0m[1mPrecompiling...[22m
[90m===[39m
[32m[1mPrecompiling[22m[39m packages...
   1865.7 ms[32m  ✓ [39m[90mDataStructures[39m
    406.3 ms[32m  ✓ [39m[90mSortingAlgorithms[39m
   1567.3 ms[32m  ✓ [39m[90mStatsBase[39m
  50402.1 ms[32m  ✓ [39mPlotsZygote
[0m[1mWaiting for other notebooks to finish Pkg operations...[22m
[90m===[39m

[0m[1mResolving...[22m
[90m===[39m
[33m[1m┌ [22m[39m[33m[1mWarning: [22m[39mPkg operation failed. Fixing stdlib dependencies and trying again...
[33m[1m└ [22m[39m[90m@ GracefulPkg ~/.julia/packages/GracefulPkg/GQ6My/src/apply strategies.jl:96[39m

[0m[1mResolving...[22m
[90m===[39m
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Project.toml`
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Manifest.toml`

[0m[1mInstantiating...[22m
[90m===[39m

[0m[1mPrecompiling...[22m
[90m===[39m
[32m[1mPrecompiling[22m[39m packages...
   1865.7 ms[32m  ✓ [39m[90mDataStructures[39m
    406.3 ms[32m  ✓ [39m[90mSortingAlgorithms[39m
   1567.3 ms[32m  ✓ [39m[90mStatsBase[39m
  50402.1 ms[32m  ✓ [39mPlotsnbpkg_sync
[0m[1mWaiting for other notebooks to finish Pkg operations...[22m
[90m===[39m

[0m[1mResolving...[22m
[90m===[39m
[33m[1m┌ [22m[39m[33m[1mWarning: [22m[39mPkg operation failed. Fixing stdlib dependencies and trying again...
[33m[1m└ [22m[39m[90m@ GracefulPkg ~/.julia/packages/GracefulPkg/GQ6My/src/apply strategies.jl:96[39m

[0m[1mResolving...[22m
[90m===[39m
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Project.toml`
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Manifest.toml`

[0m[1mInstantiating...[22m
[90m===[39m

[0m[1mPrecompiling...[22m
[90m===[39m
[32m[1mPrecompiling[22m[39m packages...
   1865.7 ms[32m  ✓ [39m[90mDataStructures[39m
    406.3 ms[32m  ✓ [39m[90mSortingAlgorithms[39m
   1567.3 ms[32m  ✓ [39m[90mStatsBase[39m
  50402.1 ms[32m  ✓ [39mPlotsPlotlyKaleido
[0m[1mWaiting for other notebooks to finish Pkg operations...[22m
[90m===[39m

[0m[1mResolving...[22m
[90m===[39m
[33m[1m┌ [22m[39m[33m[1mWarning: [22m[39mPkg operation failed. Fixing stdlib dependencies and trying again...
[33m[1m└ [22m[39m[90m@ GracefulPkg ~/.julia/packages/GracefulPkg/GQ6My/src/apply strategies.jl:96[39m

[0m[1mResolving...[22m
[90m===[39m
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Project.toml`
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Manifest.toml`

[0m[1mInstantiating...[22m
[90m===[39m

[0m[1mPrecompiling...[22m
[90m===[39m
[32m[1mPrecompiling[22m[39m packages...
   1865.7 ms[32m  ✓ [39m[90mDataStructures[39m
    406.3 ms[32m  ✓ [39m[90mSortingAlgorithms[39m
   1567.3 ms[32m  ✓ [39m[90mStatsBase[39m
  50402.1 ms[32m  ✓ [39mPlotsPlutoUI
[0m[1mWaiting for other notebooks to finish Pkg operations...[22m
[90m===[39m

[0m[1mResolving...[22m
[90m===[39m
[33m[1m┌ [22m[39m[33m[1mWarning: [22m[39mPkg operation failed. Fixing stdlib dependencies and trying again...
[33m[1m└ [22m[39m[90m@ GracefulPkg ~/.julia/packages/GracefulPkg/GQ6My/src/apply strategies.jl:96[39m

[0m[1mResolving...[22m
[90m===[39m
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Project.toml`
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Manifest.toml`

[0m[1mInstantiating...[22m
[90m===[39m

[0m[1mPrecompiling...[22m
[90m===[39m
[32m[1mPrecompiling[22m[39m packages...
   1865.7 ms[32m  ✓ [39m[90mDataStructures[39m
    406.3 ms[32m  ✓ [39m[90mSortingAlgorithms[39m
   1567.3 ms[32m  ✓ [39m[90mStatsBase[39m
  50402.1 ms[32m  ✓ [39mPlotsPlots
[0m[1mWaiting for other notebooks to finish Pkg operations...[22m
[90m===[39m

[0m[1mResolving...[22m
[90m===[39m
[33m[1m┌ [22m[39m[33m[1mWarning: [22m[39mPkg operation failed. Fixing stdlib dependencies and trying again...
[33m[1m└ [22m[39m[90m@ GracefulPkg ~/.julia/packages/GracefulPkg/GQ6My/src/apply strategies.jl:96[39m

[0m[1mResolving...[22m
[90m===[39m
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Project.toml`
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Manifest.toml`

[0m[1mInstantiating...[22m
[90m===[39m

[0m[1mPrecompiling...[22m
[90m===[39m
[32m[1mPrecompiling[22m[39m packages...
   1865.7 ms[32m  ✓ [39m[90mDataStructures[39m
    406.3 ms[32m  ✓ [39m[90mSortingAlgorithms[39m
   1567.3 ms[32m  ✓ [39m[90mStatsBase[39m
  50402.1 ms[32m  ✓ [39mPlotsPlotlyBase
[0m[1mWaiting for other notebooks to finish Pkg operations...[22m
[90m===[39m

[0m[1mResolving...[22m
[90m===[39m
[33m[1m┌ [22m[39m[33m[1mWarning: [22m[39mPkg operation failed. Fixing stdlib dependencies and trying again...
[33m[1m└ [22m[39m[90m@ GracefulPkg ~/.julia/packages/GracefulPkg/GQ6My/src/apply strategies.jl:96[39m

[0m[1mResolving...[22m
[90m===[39m
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Project.toml`
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Manifest.toml`

[0m[1mInstantiating...[22m
[90m===[39m

[0m[1mPrecompiling...[22m
[90m===[39m
[32m[1mPrecompiling[22m[39m packages...
   1865.7 ms[32m  ✓ [39m[90mDataStructures[39m
    406.3 ms[32m  ✓ [39m[90mSortingAlgorithms[39m
   1567.3 ms[32m  ✓ [39m[90mStatsBase[39m
  50402.1 ms[32m  ✓ [39mPlotsLaTeXStrings
[0m[1mWaiting for other notebooks to finish Pkg operations...[22m
[90m===[39m

[0m[1mResolving...[22m
[90m===[39m
[33m[1m┌ [22m[39m[33m[1mWarning: [22m[39mPkg operation failed. Fixing stdlib dependencies and trying again...
[33m[1m└ [22m[39m[90m@ GracefulPkg ~/.julia/packages/GracefulPkg/GQ6My/src/apply strategies.jl:96[39m

[0m[1mResolving...[22m
[90m===[39m
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Project.toml`
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Manifest.toml`

[0m[1mInstantiating...[22m
[90m===[39m

[0m[1mPrecompiling...[22m
[90m===[39m
[32m[1mPrecompiling[22m[39m packages...
   1865.7 ms[32m  ✓ [39m[90mDataStructures[39m
    406.3 ms[32m  ✓ [39m[90mSortingAlgorithms[39m
   1567.3 ms[32m  ✓ [39m[90mStatsBase[39m
  50402.1 ms[32m  ✓ [39mPlotsOptimisers
[0m[1mWaiting for other notebooks to finish Pkg operations...[22m
[90m===[39m

[0m[1mResolving...[22m
[90m===[39m
[33m[1m┌ [22m[39m[33m[1mWarning: [22m[39mPkg operation failed. Fixing stdlib dependencies and trying again...
[33m[1m└ [22m[39m[90m@ GracefulPkg ~/.julia/packages/GracefulPkg/GQ6My/src/apply strategies.jl:96[39m

[0m[1mResolving...[22m
[90m===[39m
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Project.toml`
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Manifest.toml`

[0m[1mInstantiating...[22m
[90m===[39m

[0m[1mPrecompiling...[22m
[90m===[39m
[32m[1mPrecompiling[22m[39m packages...
   1865.7 ms[32m  ✓ [39m[90mDataStructures[39m
    406.3 ms[32m  ✓ [39m[90mSortingAlgorithms[39m
   1567.3 ms[32m  ✓ [39m[90mStatsBase[39m
  50402.1 ms[32m  ✓ [39mPlotsPlutoTeachingTools
[0m[1mWaiting for other notebooks to finish Pkg operations...[22m
[90m===[39m

[0m[1mResolving...[22m
[90m===[39m
[33m[1m┌ [22m[39m[33m[1mWarning: [22m[39mPkg operation failed. Fixing stdlib dependencies and trying again...
[33m[1m└ [22m[39m[90m@ GracefulPkg ~/.julia/packages/GracefulPkg/GQ6My/src/apply strategies.jl:96[39m

[0m[1mResolving...[22m
[90m===[39m
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Project.toml`
[32m[1m  No Changes[22m[39m to `~/.julia/scratchspaces/c3e4b0f8-55cb-11ea-2926-15256bba5781/pkg_envs/env_ahiycoxuov/Manifest.toml`

[0m[1mInstantiating...[22m
[90m===[39m

[0m[1mPrecompiling...[22m
[90m===[39m
[32m[1mPrecompiling[22m[39m packages...
   1865.7 ms[32m  ✓ [39m[90mDataStructures[39m
    406.3 ms[32m  ✓ [39m[90mSortingAlgorithms[39m
   1567.3 ms[32m  ✓ [39m[90mStatsBase[39m
  50402.1 ms[32m  ✓ [39mPlotsenabled÷restart_recommended_msgrestart_required_msgbusy_packageswaiting_for_permission,waiting_for_permission_but_probably_disabled«cell_inputs O$cf264b86-d86f-4c4a-af3b-03b34486e5ffcell_id$cf264b86-d86f-4c4a-af3b-03b34486e5ffcodeْmd"### Visualization
Let's test our optimizers. We will simulate a loss function that depends on two parameters using the 2D Rosenbrock function:"metadatashow_logsèdisabled®skip_as_script«code_folded$ac1355a2-db94-4954-ad65-6887b7dbb7adcell_id$ac1355a2-db94-4954-ad65-6887b7dbb7adcodestd(transformed_data)metadatashow_logsèdisabled®skip_as_script«code_folded$3a100e93-7bba-4836-a4e6-e285aa6406c4cell_id$3a100e93-7bba-4836-a4e6-e285aa6406c4codehtest_data = [
    -2.463,
    -0.934,
    -1.854,
    -3.875,
    2.477,
    -1.1875,
    -1.158,
    -1.224,
    -1.344,
    -0.319,
    -0.525,
    -1.388,
    -1.837,
    -1.316,
    -0.597,
    -1.068,
    0.1412,
    -0.959,
    -1.479,
    -2.004,
    -0.1953,
    -1.222,
    -1.457,
    -0.768,
    -0.4158,
    -3.06,
    -1.428,
    -1.165,
    -0.226,
    -1.204,
    -1.135,
    -0.835,
    -2.46,
    -1.36,
    -1.239,
    -1.266,
    -0.8613,
    -1.226,
    -1.055,
    -1.037,
    -1.969,
    -1.564,
    -0.982,
    -1.238,
    -1.414,
    -2.246,
    -2.925,
    -1.3955,
    -1.237,
    -1.005,
]metadatashow_logsèdisabled®skip_as_script«code_folded$80c5a262-e758-4075-896f-a0bc7ce1534ccell_id$80c5a262-e758-4075-896f-a0bc7ce1534ccode md"Let's see if our code works:"metadatashow_logsèdisabled®skip_as_script«code_folded$8b519a7d-b64f-4c0c-8d74-17a963cb381dcell_id$8b519a7d-b64f-4c0c-8d74-17a963cb381dcodeXtip(md"It is recommended to quickly review exercise 3 from homework 1 before starting.")metadatashow_logsèdisabled®skip_as_script«code_folded$0fbd2560-1e4c-45b7-89a6-d2b622f9f907cell_id$0fbd2560-1e4c-45b7-89a6-d2b622f9f907codefunction plot_loss_surface(; kwargs...)
    return contour(
        P1,
        P2,
        (p1, p2) -> loss((p1, p2));
        xlabel="Parameter 1",
        ylabel="Parameter 2",
        kwargs...,
    )
endmetadatashow_logsèdisabled®skip_as_script«code_folded$ff5d316f-806c-4652-97d8-323462395c69cell_id$ff5d316f-806c-4652-97d8-323462395c69code٦# Please don't edit your name here, but in the cell below. Thanks!
md"Submission by: **_$(student.name)_** ($(student.email), Matr.-Nr.: $(student.id))" # DO NOT EDITmetadatashow_logsèdisabled®skip_as_script«code_folded$e5e014e6-e24d-4de0-a216-61c0f9d9c331cell_id$e5e014e6-e24d-4de0-a216-61c0f9d9c331codetypeof(dt)metadatashow_logsèdisabled®skip_as_script«code_folded$02a62f7b-6014-439a-a254-49f53f204abbcell_id$02a62f7b-6014-439a-a254-49f53f204abbcode7md"### Exercise 1.1 – Composite types & constructors"metadatashow_logsèdisabled®skip_as_script«code_folded$bcdd297b-c52c-4076-9329-929d69b8021bcell_id$bcdd297b-c52c-4076-9329-929d69b8021bcodemd"### Visualization
As we can see in this plot, our original data didn't come from a normal distribution.
Standardization transforms the data such that $\mu = 0$ and $\sigma=1$, but doesn't make it normally distributed.
"metadatashow_logsèdisabled®skip_as_script«code_folded$3f81ccce-5744-42ba-aa1e-b3da6212b9efcell_id$3f81ccce-5744-42ba-aa1e-b3da6212b9efcode>plot_trajectory(optimizers; steps=50, params_init=[-2.0, 1.0])metadatashow_logsèdisabled®skip_as_script«code_folded$a3634333-1149-4392-a7e9-350a56d67d2bcell_id$a3634333-1149-4392-a7e9-350a56d67d2bcodefunction plot_trajectory(optimizers; steps=30, params_init=[-1.0, 1.0])
    # Plot the level sets of the loss function
    p = plot_loss_surface(; c=:gray, colorbar=false)

    # Allocate an array to save the trajectory
    trajectory = similar(params_init, 2, steps + 1)
    trajectory[:, 1] = params_init

    for (name, opt) in optimizers
        # Use initial parameters
        params = params_init

        # Setup the optimizer
        state = Optimisers.setup(opt, params)

        for i in 1:steps
            # Compute the gradient
            # We will learn how this works in the lecture on autodiff next week
            grad = Zygote.gradient(loss, params)[1]

            # Update state and parameters
            state, params = Optimisers.update(state, params, grad)

            # Save params into trajectory
            trajectory[:, i+1] = params
        end
        # Plot trajectory on top of the loss surface
        plot!(
            p,
            trajectory[1, :],
            trajectory[2, :];
            label="$name",
            marker=:o,
            markerstrokewidth=0.5,
            markersize=2,
            lw=2,
            legend=:topright,
            xlims=(-2, 2),
            ylims=(-2, 2),
        )
    end
    return p
endmetadatashow_logsèdisabled®skip_as_script«code_folded$be2c5285-fbd8-4c37-8b17-db6db95c8a4ecell_id$be2c5285-fbd8-4c37-8b17-db6db95c8a4ecodetask(
    md"Now define two functions `transform` and `inverse_transform`:
1. A function `transform` that takes an array and a `Standardize` object and implements the standardization

$X' = \frac{X-\mu}{\sigma} \quad .$

2. A function `inverse_transform` that takes an array and a `Standardize` object and implements the inverse standardization

$X = \left(X' \cdot \sigma\right) + \mu \quad .$

",
    2,
)metadatashow_logsèdisabled®skip_as_script«code_folded$ef9a0669-2d02-4f1b-aa99-6f6473d37c0fcell_id$ef9a0669-2d02-4f1b-aa99-6f6473d37c0fcodeMtask(
    md"Define a type `GradientDescent` that implements [gradient descent](https://en.wikipedia.org/wiki/Gradient_descent). It should:

*  be a sub-type of `AbstractRule`
*  have a learning rate `lr` as its only field
*  have a default learning rate of `0.1`, implemented in an outer constructor `GradientDescent()`

",
    2,
)metadatashow_logsèdisabled®skip_as_script«code_folded$aaea0bbf-868d-4fe0-b348-307449d06517cell_id$aaea0bbf-868d-4fe0-b348-307449d06517code# Write your code here!metadatashow_logsèdisabled®skip_as_script«code_folded$c080e799-b5c5-42cf-b5f1-8c36da89fc8fcell_id$c080e799-b5c5-42cf-b5f1-8c36da89fc8fcode!md"### Exercise 2.3 – `apply!`"metadatashow_logsèdisabled®skip_as_script«code_folded$569173af-9e54-49cb-b1cb-88b8cbda57a6cell_id$569173af-9e54-49cb-b1cb-88b8cbda57a6codeUmd"And let's test the inverse transformation. The following vectors should be equal:"metadatashow_logsèdisabled®skip_as_script«code_folded$f60be2e0-9b43-46b5-96ef-7747ab56e164cell_id$f60be2e0-9b43-46b5-96ef-7747ab56e164codeٺfeedback = """
The homework took me around XX minutes.

In the lecture / homework I would have liked more detailed explanations on:
* foo
* bar

I liked:
* baz

I didn't like:
* qux
""";metadatashow_logsèdisabled®skip_as_script«code_folded$dc35d701-ab40-4933-b4c5-35a81b3f834acell_id$dc35d701-ab40-4933-b4c5-35a81b3f834acode>@bind lr1 Slider(0.01:0.01:0.2, default=0.15, show_value=true)metadatashow_logsèdisabled®skip_as_script«code_folded$a96abf48-cacf-41f8-bb7a-3d085bdb0a62cell_id$a96abf48-cacf-41f8-bb7a-3d085bdb0a62codeLmd"You can also implement [more variants](https://en.wikipedia.org/wiki/Stochastic_gradient_descent#Extensions_and_variants) or simply use [those implemented in Optimisers.jl](https://fluxml.ai/Optimisers.jl/dev/api/#Optimisation-Rules).

Click `plot_trajectory` below to reveal the code that produced the plot.
The most relevant part is the inner loop where the optimizer is called:

```julia
state = Optimisers.setup(opt, params)

for i in 1:steps
	grad = ... # Compute gradient. We will learn how this works next week.

	state, params = Optimisers.update(state, params, grad)
end
```
"metadatashow_logsèdisabled®skip_as_script«code_folded$58a671a1-3059-4fa9-b758-f3a76a573aa5cell_id$58a671a1-3059-4fa9-b758-f3a76a573aa5code# Write your code heremetadatashow_logsèdisabled®skip_as_script«code_folded$4eac0e3f-7212-4038-a24e-8d6ca3fbe659cell_id$4eac0e3f-7212-4038-a24e-8d6ca3fbe659codeNif !@isdefined(GradientDescent)
    keep_working(md"Make sure that you define a struct called `GradientDescent`.")
elseif !hasmethod(
    Optimisers.apply!, Tuple{GradientDescent,Nothing,Vector{Float64},Vector{Float64}}
)
    keep_working()
else
    let
        gd = GradientDescent(2.0)
        grad = [1.0, 2.0]
        state_new, grad_new = Optimisers.apply!(gd, nothing, [0.0, 0.0], grad)
        if ismissing(grad_new)
            still_missing()
        elseif isnothing(grad_new)
            keep_working()
        elseif !isnothing(state_new)
            keep_working(md"Don't modify the state.")
        elseif !(grad_new ≈ [2.0, 4.0])
            keep_working(
                md"The answer is not quite right. There is an error in the update of the gradient.",
            )
        else
            correct()
        end
    end
endmetadatashow_logsèdisabled®skip_as_script«code_folded$3d638561-6760-4260-991a-b0b0c77745a3cell_id$3d638561-6760-4260-991a-b0b0c77745a3codeusing Statisticsmetadatashow_logsèdisabled®skip_as_script«code_folded$17ff11e9-84f8-4911-845b-930a53c73e0ecell_id$17ff11e9-84f8-4911-845b-930a53c73e0ecodedt.meanmetadatashow_logsèdisabled®skip_as_script«code_folded$3ac8faba-1af9-4fc6-a1d0-37225b9ebb02cell_id$3ac8faba-1af9-4fc6-a1d0-37225b9ebb02code^md"## Exercise 2 – Gradient-based optimization
As we have seen in the previous exercise, structs / composite types are a common way to implement algorithms.
In this exercise, we will extend the [gradient-based optimization algorithms](https://en.wikipedia.org/wiki/Gradient_descent) from [Optimisers.jl](https://github.com/FluxML/Optimisers.jl/).
"metadatashow_logsèdisabled®skip_as_script«code_folded$bb0d58f9-380e-43fa-9524-0108a2816884cell_id$bb0d58f9-380e-43fa-9524-0108a2816884codebfunction transform(xs, dt::Standardize)
    return missing # Replace `missing` with your code!
endmetadatashow_logsèdisabled®skip_as_script«code_folded$5061a130-fc0a-4306-bdf5-6966e8de938acell_id$5061a130-fc0a-4306-bdf5-6966e8de938acodexbegin
    md_parse(str) = Markdown.parse(str)
    md_parse(md::Markdown.MD) = md
    function task(text, pts=1)
        if pts == 1
            pts_str = "(1 point)"
        elseif pts == 0
            pts_str = ""
        else
            pts_str = "($pts points)"
        end
        Markdown.MD(Markdown.Admonition("Task", "Task " * pts_str, [md_parse(text)]))
    end
end;metadatashow_logsèdisabled®skip_as_script«code_folded$ddd6e83e-5a0d-4ff0-afe4-dedfc860994ccell_id$ddd6e83e-5a0d-4ff0-afe4-dedfc860994ccodemd"### Student information"metadatashow_logsèdisabled®skip_as_script«code_folded$f9192279-9d12-485e-bb9d-650be2dbd878cell_id$f9192279-9d12-485e-bb9d-650be2dbd878codeA@bind lr2 Slider(0.001:0.001:0.05, default=0.01, show_value=true)metadatashow_logsèdisabled®skip_as_script«code_folded$78fcd02f-1a6e-4799-b042-4542a1ec7847cell_id$78fcd02f-1a6e-4799-b042-4542a1ec7847code#plot_standardization(test_data, dt)metadatashow_logsèdisabled®skip_as_script«code_folded$2341dd4a-a35a-4a62-815a-e972d04844abcell_id$2341dd4a-a35a-4a62-815a-e972d04844abcodeٹmd"""Let's plot the trajectory of our optimizers on the "loss surface".

Add as many optimizers and sliders as you want, change the initial parameters and the number of steps taken.
"""metadatashow_logsèdisabled®skip_as_script«code_folded$d36914f8-f7d4-407a-a842-436f4035157bcell_id$d36914f8-f7d4-407a-a842-436f4035157bcodeٰmd"## Exercise 1 – Standardization
In this exercise, we will refactor the standardization code from homework 1 by using custom types.
Let's load the dataset from last time:
"metadatashow_logsèdisabled®skip_as_script«code_folded$3b65f124-75c2-4fb3-8b59-94015500acbfcell_id$3b65f124-75c2-4fb3-8b59-94015500acbfcode"P1 = P2 = range(-2, 2; length=51);metadatashow_logsèdisabled®skip_as_script«code_folded$755b8685-0711-48a2-a3eb-f80af39f10e1cell_id$755b8685-0711-48a2-a3eb-f80af39f10e1code٣begin
    using PlutoUI
    using PlutoTeachingTools
    using Zygote

    using LaTeXStrings
    using Plots
    import PlotlyBase, PlotlyKaleido
    plotly()
endmetadatashow_logsèdisabled®skip_as_script«code_folded$3bb76227-82cd-4924-bfb3-1b8504e2dc44cell_id$3bb76227-82cd-4924-bfb3-1b8504e2dc44codeJloss(params) = 2 * params[1]^2 + (2 * params[2] - params[1])^2 - params[1]metadatashow_logsèdisabled®skip_as_script«code_folded$5dc7d04d-f6a5-4265-b890-d74ea4b3c602cell_id$5dc7d04d-f6a5-4265-b890-d74ea4b3c602code# Write your code heremetadatashow_logsèdisabled®skip_as_script«code_folded$fd30da51-0890-4ebe-8b14-8975ec12fec0cell_id$fd30da51-0890-4ebe-8b14-8975ec12fec0codeif !@isdefined(Standardize)
    keep_working(md"Make sure that you define a struct called `Standardize`.")
elseif !hasmethod(Standardize, Tuple{Int,Int})
    keep_working(md"The inner constructor has not yet been defined.")
elseif !hasmethod(Standardize, Tuple{Vector{Int}})
    keep_working(md"The outer constructor has not yet been defined.")
else
    let
        dtt1 = Standardize(0, 1)
        train = [1, 4, 5]
        dtt2 = Standardize(train)

        if ismissing(dtt1)
            still_missing()
        elseif isnothing(dtt1)
            keep_working(
                md"Did you forget to return a `new` object in the inner constructor?"
            )
        elseif ismissing(dtt1)
            still_missing(md"Your inner constructor still returns `missing`.")
        elseif isnothing(dtt2)
            keep_working(md"Did you forget to write `return` in the outer constructor?")
        elseif ismissing(dtt2)
            still_missing(md"Replace `missing` in the outer constructor with your answer.")
        elseif !(hasfield(Standardize, :mean) && hasfield(Standardize, :std))
            keep_working(md"`Standardize` should have two fields called `mean` and `std`.")
        elseif !(dtt2.mean ≈ 3.3333333333333335)
            keep_working(
                md"The answer is not quite right. The mean `μ` wasn't computed correctly in the outer constructor.",
            )
        elseif !(dtt2.std ≈ 2.081665999466133)
            keep_working(
                md"The answer is not quite right. The standard deviation `σ` wasn't computed correctly in the outer constructor.",
            )
        else
            correct()
        end
    end
endmetadatashow_logsèdisabled®skip_as_script«code_folded$8ece9aea-20f5-41db-95ca-08c8d4d2d4c1cell_id$8ece9aea-20f5-41db-95ca-08c8d4d2d4c1codeAtask("Please add your student information to the cell below.", 0)metadatashow_logsèdisabled®skip_as_script«code_folded$b0d679ba-13f8-4e70-ac42-68acb2ff83d1cell_id$b0d679ba-13f8-4e70-ac42-68acb2ff83d1code١task(md"Define an `Optimisers.init` function for `GradientDescent` that returns `nothing`.

We return `nothing` since gradient descent doesn't require a state.")metadatashow_logsèdisabled®skip_as_script«code_folded$f83196a4-a0fd-44a3-b3d1-29730599830dcell_id$f83196a4-a0fd-44a3-b3d1-29730599830dcode+transformed_data = transform(test_data, dt)metadatashow_logsèdisabled®skip_as_script«code_folded$6d5bf1e5-5ab0-4351-89d0-ddb6fcfa27b6cell_id$6d5bf1e5-5ab0-4351-89d0-ddb6fcfa27b6codeif !@isdefined(GradientDescent)
    keep_working(md"Make sure that you define a struct called `GradientDescent`.")
elseif !hasmethod(GradientDescent, Tuple{Float64})
    keep_working(md"The inner constructor has not yet been defined.")
elseif !hasmethod(GradientDescent, Tuple{})
    keep_working(md"The outer constructor has not yet been defined.")
else
    let
        gd1 = GradientDescent(1.2)
        gd2 = GradientDescent()
        if !hasfield(GradientDescent, :lr)
            keep_working(md"`GradientDescent` should have a field called `lr`.")
        elseif !(gd1.lr ≈ 1.2)
            keep_working()
        elseif !(gd2.lr ≈ 0.1)
            keep_working(md"The default value for `lr` should be `0.1`.")
        else
            correct()
        end
    end
endmetadatashow_logsèdisabled®skip_as_script«code_folded$822d03c6-48f8-47b0-8f25-b2de45e4c589cell_id$822d03c6-48f8-47b0-8f25-b2de45e4c589codeeMarkdown.MD(
    Markdown.Admonition(
        "Task",
        "Optional task",
        [
            md"Implement the *Adam* optimizer, which was introduced
            in [this paper](https://arxiv.org/abs/1412.6980) by Kingma and Ba.
            Add it to the visualization above and compare it to Optimizer.jl's Adam implementation.",
        ],
    ),
)metadatashow_logsèdisabled®skip_as_script«code_folded$bebbf87b-cd7b-43d7-8025-938fc4c6944dcell_id$bebbf87b-cd7b-43d7-8025-938fc4c6944dcodetask(md"Define an `Optimisers.apply!` function for `GradientDescent` that
* doesn't modify the state (since gradient descent doesn't require a state)
* scales the gradient by the learning rate
")metadatashow_logsèdisabled®skip_as_script«code_folded$c2adc38f-84e3-486f-93d8-b88eea63a09bcell_id$c2adc38f-84e3-486f-93d8-b88eea63a09bcode6md"### Exercise 1.2 – Transform & Inverse transform"metadatashow_logsèdisabled®skip_as_script«code_folded$5370c50b-a9b8-41dc-8cfe-1f0389df97c3cell_id$5370c50b-a9b8-41dc-8cfe-1f0389df97c3code(md"### Optional Task – Adam optimizer"metadatashow_logsèdisabled®skip_as_script«code_folded$32e8ee04-4378-4377-ae47-b65e5ce70667cell_id$32e8ee04-4378-4377-ae47-b65e5ce70667codemd"### Exercise 2.2 – `init`"metadatashow_logsèdisabled®skip_as_script«code_folded$befba318-8595-4fc4-b42e-9c9125e7abfbcell_id$befba318-8595-4fc4-b42e-9c9125e7abfbcodeDtip(
    md"Statefulness could also have been implemented by making the state a field in the struct of the optimizer and/or making the struct mutable.

However, mutable structs are usually less performant. The dimensionality of the state also often depends on the dimensionality of the input parameters we optimize over.",
)metadatashow_logsèdisabled®skip_as_script«code_folded$d5052369-0b47-42e7-b661-058c7365c032cell_id$d5052369-0b47-42e7-b661-058c7365c032codeٕtip(
    md"**Reminder:** By convention, functions that modify their inputs in-place are given an exclamation point `!` at the end of their name.",
)metadatashow_logsèdisabled®skip_as_script«code_folded$cf3c52c7-fc5e-4191-be9d-394660385801cell_id$cf3c52c7-fc5e-4191-be9d-394660385801code;dt = Standardize(test_data) # dt like "data transformation"metadatashow_logsèdisabled®skip_as_script«code_folded$2cd9cef0-d746-411a-861f-b8a035f4a1d3cell_id$2cd9cef0-d746-411a-861f-b8a035f4a1d3codemean(transformed_data)metadatashow_logsèdisabled®skip_as_script«code_folded$d15eb189-6e4d-4c70-a1cb-159e6a4eb8ebcell_id$d15eb189-6e4d-4c70-a1cb-159e6a4eb8ebcodetip(
    md"Gradient descent is typically used in deep learning in combination with mini-batches, which introduce stochasticity.

This example had no stochasticity and other optimization algorithms would have been better suited.",
)metadatashow_logsèdisabled®skip_as_script«code_folded$955a9751-38d0-4327-9a95-a0523c2d54b8cell_id$955a9751-38d0-4327-9a95-a0523c2d54b8codedt.stdmetadatashow_logsèdisabled®skip_as_script«code_folded$62a1289b-ce6a-444d-8b20-92bd4fa3d05dcell_id$62a1289b-ce6a-444d-8b20-92bd4fa3d05dcodeAmd"For the purpose of plotting, we define a range of parameters:"metadatashow_logsèdisabled®skip_as_script«code_folded$221fd504-4cd6-4bab-b2a5-a590fff26a52cell_id$221fd504-4cd6-4bab-b2a5-a590fff26a52codejfunction inverse_transform(xs, dt::Standardize)
    return missing # Replace `missing` with your code!
endmetadatashow_logsèdisabled®skip_as_script«code_folded$a191392f-eb62-459d-8554-901d9db29950cell_id$a191392f-eb62-459d-8554-901d9db29950code5inverse_transform(transformed_data, dt) ≈ test_datametadatashow_logsèdisabled®skip_as_script«code_folded$67d7c60c-1c5e-4760-a9e1-4538e2ccc10ecell_id$67d7c60c-1c5e-4760-a9e1-4538e2ccc10ecodemd"""#### Initializing the optimizer
Some optimizers require a state. This state is used to save additional information about previous optimization steps, for example in optimizers that use "momentum" terms like [ADAM](https://en.wikipedia.org/wiki/Stochastic_gradient_descent#Adam).

When setting up an Optimizer in Optimisers.jl, `init` is called on it, which initializes a state.
`init` takes two arguments: an optimizer object and an array of initial parameters.

```julia
function Optimisers.init(alg::MyOptimiser, params_init::AbstractArray)
	state = ... # some computation
	return state
end
```

The state is then updated in the `apply!` function.
"""metadatashow_logsèdisabled®skip_as_script«code_folded$d16b1a65-5da9-46ac-b0b8-59e55ced37f3cell_id$d16b1a65-5da9-46ac-b0b8-59e55ced37f3code$md"### Exercise 2.1 – Constructor"metadatashow_logsèdisabled®skip_as_script«code_folded$7de85c6f-996a-4d5b-8236-271922aeb908cell_id$7de85c6f-996a-4d5b-8236-271922aeb908codefunction plot_standardization(xs, dt::Standardize; nbins=20, scale=80)
    p = histogram(xs; nbins=nbins, alpha=0.7, label="Original data")
    histogram!(p, transform(xs, dt); nbins=nbins, alpha=0.5, label="Standardized data")
    plot!(
        p,
        x -> 1 / (2π) * exp(-0.5 * x^2) * scale;
        color=:gray,
        lw=2,
        style=:dash,
        label="Standard normal distribution (scaled)",
    )
    return p
endmetadatashow_logsèdisabled®skip_as_script«code_folded$edb7814a-eddf-4c87-8857-19bb0a0c0241cell_id$edb7814a-eddf-4c87-8857-19bb0a0c0241codeٴmd"""# Feedback
Please help us improve the course by giving us feedback!

You can write whatever you want in the following string. Feel free to add or delete whatever you want.
"""metadatashow_logsèdisabled®skip_as_script«code_folded$2258b8c6-e8b7-4c06-9ece-53b254db6a2ccell_id$2258b8c6-e8b7-4c06-9ece-53b254db6a2ccodetask(
    md"Create a parametric composite type `Standardize` with two fields `mean` and `std` (for $\mu$ and $\sigma$) using the type parameter `T<:Real`.

These two fields will hold the mean and the standard deviation of the standardization transformation.

`Standardize` should have two constructors:
1. An inner constructor that takes two numbers $μ$ and $σ$. Throw an `error` if $σ ≤ 0$.
2. An outer constructor that takes an array `data`, computes its mean and standard deviation and calls the inner constructor.

---

You are allowed to use the `mean` and `std` functions from the standard library package [Statistics.jl](https://docs.julialang.org/en/v1/stdlib/Statistics/).
",
    4,
)metadatashow_logsèdisabled®skip_as_script«code_folded$8e8d9f57-0f04-4a91-b69f-273fe1fafd61cell_id$8e8d9f57-0f04-4a91-b69f-273fe1fafd61code5html"""<style>.dont-panic{ display: none }</style>"""metadatashow_logsèdisabled®skip_as_script«code_folded$f7347c06-c1b7-11ed-3b8e-fbf167ce9cbacell_id$f7347c06-c1b7-11ed-3b8e-fbf167ce9cbacode;html"""
	<h1 style="text-align:left">
		Julia for Machine Learning
	</h1>
	<div style="text-align:left">
		<p style="font-weight:bold; font-size: 35px; font-variant: small-caps; margin: 0px">
			Homework 3: Custom types
		</p>
		<p style="font-size: 20px;">
			TU Berlin, Summer Semester 2026<br>
		</p>
	</div>
"""metadatashow_logsèdisabled®skip_as_script«code_folded$c322fd53-78db-40ae-b7ba-612200ab6617cell_id$c322fd53-78db-40ae-b7ba-612200ab6617codepmd"""### Interlude: Gradient-based optimization in Deep Learning
Gradient-based optimization methods are used in deep learning, where we want to optimize a neural network $f$ that is parametrized by parameters $\theta$ (e.g. the weights and biases of $f$).

This neural network could e.g. be a classifier that predicts the output class $\hat{y}$ for some input image $x$:

$\hat{y} = f_\theta(x)$

In [supervised learning](https://en.wikipedia.org/wiki/Supervised_learning),
we are also given true labels $y$.
Based on the true and predicted labels, we define a loss

$\mathcal{L}_\theta(\hat{y}, y)$

which depends on $\theta$, since the parameters of our neural network determine the prediction $\hat{y}$.

To optimize $\theta$, we typically compute the gradient of our loss with respect to our parameters and update the parameters using gradient-based optimization methods.
"""metadatashow_logsèdisabled®skip_as_script«code_folded$dc4f7f55-dde5-4ee6-b43d-7f64269b55d1cell_id$dc4f7f55-dde5-4ee6-b43d-7f64269b55d1code# Write your code heremetadatashow_logsèdisabled®skip_as_script«code_folded$cd7c244d-8a4c-4aaf-ad4b-891744e004becell_id$cd7c244d-8a4c-4aaf-ad4b-891744e004becodeplot_loss_surface(; fill=true)metadatashow_logsèdisabled®skip_as_script«code_folded$ed873ea2-d4bd-46e7-b89b-4e5494b606e6cell_id$ed873ea2-d4bd-46e7-b89b-4e5494b606e6codeoptimizers = Dict(
    "GradientDescent" => GradientDescent(lr1), # our implementation
    "Momentum" => Momentum(lr2),    # from Optimisers.jl
    "ADAM" => ADAM(0.1),    # from Optimisers.jl
)metadatashow_logsèdisabled®skip_as_script«code_folded$b3832fb6-dd19-4b38-8117-b0a11d1bc34fcell_id$b3832fb6-dd19-4b38-8117-b0a11d1bc34fcode md"""### Interlude: Understanding Optimisers.jl
All optimization algorithms in Optimisers.jl are sub-types of the abstract type `AbstractRule`.

To extend Optimisers.jl, we simply need to define a custom sub-type and overload two functions `init` and `apply!` using multiple dispatch.
"""metadatashow_logsèdisabled®skip_as_script«code_folded$bdcb27c5-0603-49ac-b831-d78c558b31f0cell_id$bdcb27c5-0603-49ac-b831-d78c558b31f0code0md"Due date: **Monday, May 11th 2026 at 23:59**"metadatashow_logsèdisabled®skip_as_script«code_folded$33866006-11d7-46cc-870b-fec519a2b541cell_id$33866006-11d7-46cc-870b-fec519a2b541codevtip(
    md"The purpose of this exercise is to teach you how to extend functionality from external Julia packages.",
)metadatashow_logsèdisabled®skip_as_script«code_folded$44ec9e94-f6af-431e-8841-bae44431dfa3cell_id$44ec9e94-f6af-431e-8841-bae44431dfa3codeif student.name == "Mara Mustermann"
    still_missing(md"""Please replace `"Mara Mustermann"` with your name.
            Use `Shift+Enter` to run your edits.""")
elseif student.email == "m.mustermann@campus.tu-berlin.de"
    still_missing(md"Please enter your TU Berlin E-Mail address.")
elseif student.id == 456123
    still_missing(md"Please enter your TU Berlin student ID (Matrikelnummer).")
elseif !isa(student.id, Number)
    still_missing(md"Please enter your TU Berlin student ID as number, not a string.")
else
    correct()
endmetadatashow_logsèdisabled®skip_as_script«code_folded$57a8108f-9ad3-4cc2-9372-bb291fc3bf86cell_id$57a8108f-9ad3-4cc2-9372-bb291fc3bf86codeTableOfContents()metadatashow_logsèdisabled®skip_as_script«code_folded$50b34968-a45f-4c5b-a83d-7a5b47740007cell_id$50b34968-a45f-4c5b-a83d-7a5b47740007codemd"""#### Applying the update step
The actual update step is handled automatically by Optimisers.jl.
After implementing the "internal" functions `init` and `apply!` to define a custom optimizer, we can use the "public" API:

- `Optimisers.setup`: calls `init` to set up the optimizer
- `Optimisers.update`: calls `apply!` to compute `new_grad` and `next_state` and performs the update step `params_new = params - new_grad`
"""metadatashow_logsèdisabled®skip_as_script«code_folded$06c0ad65-22d4-4c8e-ae19-4f05ba125e79cell_id$06c0ad65-22d4-4c8e-ae19-4f05ba125e79codekmd"### Initializing packages
**Note:** Running this notebook for the first time can take several minutes.
"metadatashow_logsèdisabled®skip_as_script«code_folded$dcbf8963-4a5c-4e7d-81a9-3dce27fb3117cell_id$dcbf8963-4a5c-4e7d-81a9-3dce27fb3117codemd"Let's check whether the transformed data has $\mu'=0$ and $\sigma'=1$.

Note that due to [rounding errors](https://en.wikipedia.org/wiki/Machine_epsilon) arising from floating point arithmetic, the results will not be exactly zero and one:
"metadatashow_logsèdisabled®skip_as_script«code_folded$5762be30-3084-4eda-9642-19dc9d4dcb10cell_id$5762be30-3084-4eda-9642-19dc9d4dcb10codeif !@isdefined(GradientDescent)
    keep_working(md"Make sure that you define a struct called `GradientDescent`.")
elseif !hasmethod(Optimisers.init, Tuple{GradientDescent,Vector{Float64}})
    keep_working()
else
    let
        gd = GradientDescent()
        state = Optimisers.init(gd, [1.0])
        if !isnothing(state)
            keep_working(md"Initializing `GradientDescent` should return `nothing`.")
        else
            correct()
        end
    end
endmetadatashow_logsèdisabled®skip_as_script«code_folded$39063d08-d687-45a2-8367-734b12dcefeacell_id$39063d08-d687-45a2-8367-734b12dcefeacode(if !@isdefined(Standardize)
    keep_working(md"Make sure that you define a struct called `Standardize`.")
elseif !@isdefined(transform)
    not_defined(:transform)
elseif !@isdefined(inverse_transform)
    not_defined(:inverse_transform)
else
    let
        train = [1, 4, 5]
        test = [2, 1, 3]
        dtt = Standardize(train)

        res_tf = transform(test, dtt)
        sol_tf = [-0.6405126152203485, -1.12089707663561, -0.1601281538050872]

        res_itf = inverse_transform(res_tf, dtt)

        if ismissing(res_tf)
            still_missing(md"Replace `missing` in `transform` with your answer.")
        elseif isnothing(res_tf)
            keep_working(md"Did you forget to write `return` in `transform`?")
        elseif !(res_tf ≈ sol_tf)
            keep_working(md"The answer is not quite right. Keep working on `transform`.")
        elseif ismissing(res_itf)
            still_missing(md"Replace `missing` in `inverse_transform` with your answer.")
        elseif isnothing(res_itf)
            keep_working(md"Did you forget to write `return` in `inverse_transform`?")
        elseif !(res_itf ≈ test)
            keep_working(
                md"The answer is not quite right. Keep working on `inverse_transform`."
            )
        else
            correct()
        end
    end
endmetadatashow_logsèdisabled®skip_as_script«code_folded$582cf667-b85b-4a7d-bb17-88d4776fc240cell_id$582cf667-b85b-4a7d-bb17-88d4776fc240codeusing Optimisersmetadatashow_logsèdisabled®skip_as_script«code_folded$d03e4e95-faab-4ab3-ab27-81189cbd8231cell_id$d03e4e95-faab-4ab3-ab27-81189cbd8231codeّstudent = (
    name="Mara Mustermann",
    email="m.mustermann@campus.tu-berlin.de", # TU Berlin email address
    id=456123, # Matrikelnummer
)metadatashow_logsèdisabled®skip_as_script«code_folded$e0705a25-a01e-43a8-8c1d-ccf0da22fca7cell_id$e0705a25-a01e-43a8-8c1d-ccf0da22fca7codermd"""#### Updating the optimizer
The function `apply!` can do two things before the final update step is applied:
1. it can modify the gradient
1. it can update the optimizer state

```julia
function Optimisers.apply!(alg::MyOptimiser, state, params, grad)
  grad_new = ... # some computation
  state_new = ... # some computation
  return state_new, grad_new
end
```
"""metadatashow_logsèdisabled®skip_as_script«code_foldedënotebook_id$5c9c9f8c-4a20-11f1-0bf5-5997a3917a21in_temp_dir¨metadata