Files
FYS-STK4155/doc/LectureNotes/_build/html/project2.html
T
Morten Hjorth-Jensen ec650f521d update of p2
2025-10-14 07:01:07 +02:00

926 lines
58 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en" data-content_root="./" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Project 2 on Machine Learning, deadline November 10 (Midnight) &#8212; Applied Data Analysis and Machine Learning</title>
<script data-cfasync="false">
document.documentElement.dataset.mode = localStorage.getItem("mode") || "";
document.documentElement.dataset.theme = localStorage.getItem("theme") || "";
</script>
<!-- Loaded before other Sphinx assets -->
<link href="_static/styles/theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="_static/styles/bootstrap.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="_static/styles/pydata-sphinx-theme.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link href="_static/vendor/fontawesome/6.5.2/css/all.min.css?digest=dfe6caa3a7d634c4db9b" rel="stylesheet" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.5.2/webfonts/fa-solid-900.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.5.2/webfonts/fa-brands-400.woff2" />
<link rel="preload" as="font" type="font/woff2" crossorigin href="_static/vendor/fontawesome/6.5.2/webfonts/fa-regular-400.woff2" />
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/styles/sphinx-book-theme.css?v=eba8b062" />
<link rel="stylesheet" type="text/css" href="_static/togglebutton.css?v=13237357" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css?v=76b2166b" />
<link rel="stylesheet" type="text/css" href="_static/mystnb.8ecb98da25f57f5357bf6f572d296f466b2cfe2517ffebfabe82451661e28f02.css?v=6644e6bb" />
<link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css?v=4fa983c6" />
<link rel="stylesheet" type="text/css" href="_static/sphinx-design.min.css?v=95c83b7e" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b" />
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b" />
<script src="_static/vendor/fontawesome/6.5.2/js/all.min.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="_static/documentation_options.js?v=9eb32ce0"></script>
<script src="_static/doctools.js?v=9a2dae69"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/clipboard.min.js?v=a7894cd8"></script>
<script src="_static/copybutton.js?v=f281be69"></script>
<script src="_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
<script>let toggleHintShow = 'Click to show';</script>
<script>let toggleHintHide = 'Click to hide';</script>
<script>let toggleOpenOnPrint = 'true';</script>
<script src="_static/togglebutton.js?v=4a39c7ea"></script>
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
<script src="_static/design-tabs.js?v=f930bc37"></script>
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
<script async="async" src="_static/sphinx-thebe.js?v=c100c467"></script>
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown';</script>
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"; const thebe_selector = ".thebe,.cell"; const thebe_selector_input = "pre"; const thebe_selector_output = ".output, .cell_output"</script>
<script>window.MathJax = {"options": {"processHtmlClass": "tex2jax_process|mathjax_process|math|output_area"}}</script>
<script defer="defer" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<script>DOCUMENTATION_OPTIONS.pagename = 'project2';</script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="prev" title="Project 1 on Machine Learning, deadline October 6 (midnight), 2025" href="project1.html" />
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<meta name="docsearch:language" content="en"/>
</head>
<body data-bs-spy="scroll" data-bs-target=".bd-toc-nav" data-offset="180" data-bs-root-margin="0px 0px -60%" data-default-mode="">
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div>
<div id="pst-scroll-pixel-helper"></div>
<button type="button" class="btn rounded-pill" id="pst-back-to-top">
<i class="fa-solid fa-arrow-up"></i>Back to top</button>
<input type="checkbox"
class="sidebar-toggle"
id="pst-primary-sidebar-checkbox"/>
<label class="overlay overlay-primary" for="pst-primary-sidebar-checkbox"></label>
<input type="checkbox"
class="sidebar-toggle"
id="pst-secondary-sidebar-checkbox"/>
<label class="overlay overlay-secondary" for="pst-secondary-sidebar-checkbox"></label>
<div class="search-button__wrapper">
<div class="search-button__overlay"></div>
<div class="search-button__search-container">
<form class="bd-search d-flex align-items-center"
action="search.html"
method="get">
<i class="fa-solid fa-magnifying-glass"></i>
<input type="search"
class="form-control"
name="q"
id="search-input"
placeholder="Search this book..."
aria-label="Search this book..."
autocomplete="off"
autocorrect="off"
autocapitalize="off"
spellcheck="false"/>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span>
</form></div>
</div>
<div class="pst-async-banner-revealer d-none">
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside>
</div>
<header class="bd-header navbar navbar-expand-lg bd-navbar d-print-none">
</header>
<div class="bd-container">
<div class="bd-container__inner bd-page-width">
<div class="bd-sidebar-primary bd-sidebar">
<div class="sidebar-header-items sidebar-primary__section">
</div>
<div class="sidebar-primary-items__start sidebar-primary__section">
<div class="sidebar-primary-item">
<a class="navbar-brand logo" href="intro.html">
<img src="_static/logo.png" class="logo__image only-light" alt="Applied Data Analysis and Machine Learning - Home"/>
<script>document.write(`<img src="_static/logo.png" class="logo__image only-dark" alt="Applied Data Analysis and Machine Learning - Home"/>`);</script>
</a></div>
<div class="sidebar-primary-item">
<script>
document.write(`
<button class="btn search-button-field search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass"></i>
<span class="search-button__default-text">Search</span>
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span>
</button>
`);
</script></div>
<div class="sidebar-primary-item"><nav class="bd-links bd-docs-nav" aria-label="Main">
<div class="bd-toc-item navbar-nav active">
<ul class="nav bd-sidenav bd-sidenav__home-link">
<li class="toctree-l1">
<a class="reference internal" href="intro.html">
Applied Data Analysis and Machine Learning
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">About the course</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="schedule.html">Course setting</a></li>
<li class="toctree-l1"><a class="reference internal" href="teachers.html">Teachers and Grading</a></li>
<li class="toctree-l1"><a class="reference internal" href="textbooks.html">Textbooks</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Review of Statistics with Resampling Techniques and Linear Algebra</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="statistics.html">1. Elements of Probability Theory and Statistical Data Analysis</a></li>
<li class="toctree-l1"><a class="reference internal" href="linalg.html">2. Linear Algebra, Handling of Arrays and more Python Features</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">From Regression to Support Vector Machines</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="chapter1.html">3. Linear Regression</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter2.html">4. Ridge and Lasso Regression</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter3.html">5. Resampling Methods</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter4.html">6. Logistic Regression</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapteroptimization.html">7. Optimization, the central part of any Machine Learning algortithm</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter5.html">8. Support Vector Machines, overarching aims</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Decision Trees, Ensemble Methods and Boosting</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="chapter6.html">9. Decision trees, overarching aims</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter7.html">10. Ensemble Methods: From a Single Tree to Many Trees and Extreme Boosting, Meet the Jungle of Methods</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Dimensionality Reduction</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="chapter8.html">11. Basic ideas of the Principal Component Analysis (PCA)</a></li>
<li class="toctree-l1"><a class="reference internal" href="clustering.html">12. Clustering and Unsupervised Learning</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Deep Learning Methods</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="chapter9.html">13. Neural networks</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter10.html">14. Building a Feed Forward Neural Network</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter11.html">15. Solving Differential Equations with Deep Learning</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter12.html">16. Convolutional Neural Networks</a></li>
<li class="toctree-l1"><a class="reference internal" href="chapter13.html">17. Recurrent neural networks: Overarching view</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Weekly material, notes and exercises</span></p>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="exercisesweek34.html">Exercises week 34</a></li>
<li class="toctree-l1"><a class="reference internal" href="week34.html">Week 34: Introduction to the course, Logistics and Practicalities</a></li>
<li class="toctree-l1"><a class="reference internal" href="exercisesweek35.html">Exercises week 35</a></li>
<li class="toctree-l1"><a class="reference internal" href="week35.html">Week 35: From Ordinary Linear Regression to Ridge and Lasso Regression</a></li>
<li class="toctree-l1"><a class="reference internal" href="exercisesweek36.html">Exercises week 36</a></li>
<li class="toctree-l1"><a class="reference internal" href="week36.html">Week 36: Linear Regression and Gradient descent</a></li>
<li class="toctree-l1"><a class="reference internal" href="exercisesweek37.html">Exercises week 37</a></li>
<li class="toctree-l1"><a class="reference internal" href="week37.html">Week 37: Gradient descent methods</a></li>
<li class="toctree-l1"><a class="reference internal" href="exercisesweek38.html">Exercises week 38</a></li>
<li class="toctree-l1"><a class="reference internal" href="week38.html">Week 38: Statistical analysis, bias-variance tradeoff and resampling methods</a></li>
<li class="toctree-l1"><a class="reference internal" href="exercisesweek39.html">Exercises week 39</a></li>
<li class="toctree-l1"><a class="reference internal" href="week39.html">Week 39: Resampling methods and logistic regression</a></li>
<li class="toctree-l1"><a class="reference internal" href="week40.html">Week 40: Gradient descent methods (continued) and start Neural networks</a></li>
<li class="toctree-l1"><a class="reference internal" href="week41.html">Week 41 Neural networks and constructing a neural network code</a></li>
<li class="toctree-l1"><a class="reference internal" href="exercisesweek41.html">Exercises week 41</a></li>
<li class="toctree-l1"><a class="reference internal" href="week42.html">Week 42 Constructing a Neural Network code with examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="exercisesweek42.html">Exercises week 42</a></li>
</ul>
<p aria-level="2" class="caption" role="heading"><span class="caption-text">Projects</span></p>
<ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="project1.html">Project 1 on Machine Learning, deadline October 6 (midnight), 2025</a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">Project 2 on Machine Learning, deadline November 10 (Midnight)</a></li>
</ul>
</div>
</nav></div>
</div>
<div class="sidebar-primary-items__end sidebar-primary__section">
</div>
<div id="rtd-footer-container"></div>
</div>
<main id="main-content" class="bd-main" role="main">
<div class="sbt-scroll-pixel-helper"></div>
<div class="bd-content">
<div class="bd-article-container">
<div class="bd-header-article d-print-none">
<div class="header-article-items header-article__inner">
<div class="header-article-items__start">
<div class="header-article-item"><button class="sidebar-toggle primary-toggle btn btn-sm" title="Toggle primary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-bars"></span>
</button></div>
</div>
<div class="header-article-items__end">
<div class="header-article-item">
<div class="article-header-buttons">
<div class="dropdown dropdown-download-buttons">
<button class="btn dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" aria-label="Download this page">
<i class="fas fa-download"></i>
</button>
<ul class="dropdown-menu">
<li><a href="_sources/project2.ipynb" target="_blank"
class="btn btn-sm btn-download-source-button dropdown-item"
title="Download source file"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-file"></i>
</span>
<span class="btn__text-container">.ipynb</span>
</a>
</li>
<li>
<button onclick="window.print()"
class="btn btn-sm btn-download-pdf-button dropdown-item"
title="Print to PDF"
data-bs-placement="left" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-file-pdf"></i>
</span>
<span class="btn__text-container">.pdf</span>
</button>
</li>
</ul>
</div>
<button onclick="toggleFullScreen()"
class="btn btn-sm btn-fullscreen-button"
title="Fullscreen mode"
data-bs-placement="bottom" data-bs-toggle="tooltip"
>
<span class="btn__icon-container">
<i class="fas fa-expand"></i>
</span>
</button>
<script>
document.write(`
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button" title="light/dark" aria-label="light/dark" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="theme-switch fa-solid fa-sun fa-lg" data-mode="light"></i>
<i class="theme-switch fa-solid fa-moon fa-lg" data-mode="dark"></i>
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg" data-mode="auto"></i>
</button>
`);
</script>
<script>
document.write(`
<button class="btn btn-sm pst-navbar-icon search-button search-button__button" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip">
<i class="fa-solid fa-magnifying-glass fa-lg"></i>
</button>
`);
</script>
<button class="sidebar-toggle secondary-toggle btn btn-sm" title="Toggle secondary sidebar" data-bs-placement="bottom" data-bs-toggle="tooltip">
<span class="fa-solid fa-list"></span>
</button>
</div></div>
</div>
</div>
</div>
<div id="jb-print-docs-body" class="onlyprint">
<h1>Project 2 on Machine Learning, deadline November 10 (Midnight)</h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
<div>
<h2> Contents </h2>
</div>
<nav aria-label="Page">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#deliverables">Deliverables</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#preamble-note-on-writing-reports-using-reference-material-ai-and-other-tools">Preamble: Note on writing reports, using reference material, AI and other tools</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#classification-and-regression-writing-our-own-neural-network-code">Classification and Regression, writing our own neural network code</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-a-analytical-warm-up">Part a): Analytical warm-up</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#reminder-about-the-gradient-machinery-from-project-1">Reminder about the gradient machinery from project 1</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-b-writing-your-own-neural-network-code">Part b): Writing your own Neural Network code</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-c-testing-against-other-software-libraries">Part c): Testing against other software libraries</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-d-testing-different-activation-functions-and-depths-of-the-neural-network">Part d): Testing different activation functions and depths of the neural network</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-e-testing-different-norms">Part e): Testing different norms</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-f-classification-analysis-using-neural-networks">Part f): Classification analysis using neural networks</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-g-critical-evaluation-of-the-various-algorithms">Part g) Critical evaluation of the various algorithms</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#summary-of-methods-to-implement-and-analyze">Summary of methods to implement and analyze</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#required-analysis">Required Analysis:</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#optional-note-that-you-should-include-at-least-two-of-these-in-the-report">Optional (Note that you should include at least two of these in the report):</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#background-literature">Background literature</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#introduction-to-numerical-projects">Introduction to numerical projects</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#format-for-electronic-delivery-of-report-and-programs">Format for electronic delivery of report and programs</a></li>
</ul>
</nav>
</div>
</div>
</div>
<div id="searchbox"></div>
<article class="bd-article">
<!-- HTML file automatically generated from DocOnce source (https://github.com/doconce/doconce/)
doconce format html Project2.do.txt -->
<!-- dom:TITLE: Project 2 on Machine Learning, deadline November 10 (Midnight) --><section class="tex2jax_ignore mathjax_ignore" id="project-2-on-machine-learning-deadline-november-10-midnight">
<h1>Project 2 on Machine Learning, deadline November 10 (Midnight)<a class="headerlink" href="#project-2-on-machine-learning-deadline-november-10-midnight" title="Link to this heading">#</a></h1>
<p><strong><a class="reference external" href="http://www.uio.no/studier/emner/matnat/fys/FYS3155/index-eng.html">Data Analysis and Machine Learning FYS-STK3155/FYS4155</a></strong>, University of Oslo, Norway</p>
<p>Date: <strong>October 14, 2025</strong></p>
<section id="deliverables">
<h2>Deliverables<a class="headerlink" href="#deliverables" title="Link to this heading">#</a></h2>
<p>First, join a group in canvas with your group partners. Pick an avaliable group for Project 2 in the <strong>People</strong> page.</p>
<p>In canvas, deliver as a group and include:</p>
<ul class="simple">
<li><p>A PDF of your report which follows the guidelines covered below and in the week 39 exercises. Additional requirements include:</p>
<ul>
<li><p>It should be around 5000 words, use the word counter in Overleaf for this. This often corresponds to 10-12 pages. References and appendices are excluded from the word count</p></li>
<li><p>It should include around 10-15 figures. You can include more figures in appendices and/or as supplemental material in your repository.</p></li>
</ul>
</li>
<li><p>A comment linking to your github repository (or folder in one of your github repositories) for this project. The repository must include</p></li>
</ul>
<p>A PDF file of the report</p>
<ul class="simple">
<li><p>A folder named Code, where you put python files for your functions and notebooks for reproducing your results. Remember to use a seed for generating random data and for train-test splits when generating final results.</p></li>
<li><p>A README file with the name of the group members</p></li>
<li><p>a short description of the project</p></li>
<li><p>a description of how to install the required packages to run your code from a requirements.txt file or similar (such as a plain text description) names and descriptions of the various notebooks in the Code folder and the results they produce</p></li>
</ul>
<section id="preamble-note-on-writing-reports-using-reference-material-ai-and-other-tools">
<h3>Preamble: Note on writing reports, using reference material, AI and other tools<a class="headerlink" href="#preamble-note-on-writing-reports-using-reference-material-ai-and-other-tools" title="Link to this heading">#</a></h3>
<p>We want you to answer the three different projects by handing in
reports written like a standard scientific/technical report. The links
at
<a class="github reference external" href="https://github.com/CompPhysics/MachineLearning/tree/master/doc/Projects">CompPhysics/MachineLearning</a>
contain more information. There you can find examples of previous
reports, the projects themselves, how we grade reports etc. How to
write reports will also be discussed during the various lab
sessions. Please do ask us if you are in doubt.</p>
<p>When using codes and material from other sources, you should refer to
these in the bibliography of your report, indicating wherefrom you for
example got the code, whether this is from the lecture notes,
softwares like Scikit-Learn, TensorFlow, PyTorch or other
sources. These sources should always be cited correctly. How to cite
some of the libraries is often indicated from their corresponding
GitHub sites or websites, see for example how to cite Scikit-Learn at
<a class="reference external" href="https://scikit-learn.org/dev/about.html">https://scikit-learn.org/dev/about.html</a>.</p>
<p>We enocurage you to use tools like ChatGPT or similar in writing the
report. If you use for example ChatGPT, please do cite it properly and
include (if possible) your questions and answers as an addition to the
report. This can be uploaded to for example your website,
GitHub/GitLab or similar as supplemental material.</p>
<p>If you would like to study other data sets, feel free to propose other
sets. What we have proposed here are mere suggestions from our
side. If you opt for another data set, consider using a set which has
been studied in the scientific literature. This makes it easier for
you to compare and analyze your results. Comparing with existing
results from the scientific literature is also an essential element of
the scientific discussion. The University of California at Irvine with
its Machine Learning repository at
<a class="reference external" href="https://archive.ics.uci.edu/ml/index.php">https://archive.ics.uci.edu/ml/index.php</a> is an excellent site to look
up for examples and inspiration. <a class="reference external" href="http://Kaggle.com">Kaggle.com</a> is an equally interesting
site. Feel free to explore these sites.</p>
</section>
</section>
<section id="classification-and-regression-writing-our-own-neural-network-code">
<h2>Classification and Regression, writing our own neural network code<a class="headerlink" href="#classification-and-regression-writing-our-own-neural-network-code" title="Link to this heading">#</a></h2>
<p>The main aim of this project is to study both classification and
regression problems by developing our own
feed-forward neural network (FFNN) code. The exercises from week 41 and 42 (see <a class="reference external" href="https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/exercisesweek41.html">https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/exercisesweek41.html</a> and <a class="reference external" href="https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/exercisesweek42.html">https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/exercisesweek42.html</a>) as well as the lecture material from the same weeks (see <a class="reference external" href="https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/week41.html">https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/week41.html</a> and <a class="reference external" href="https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/week42.html">https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/week42.html</a>) should contain enough information for you to get started with writing your own code.</p>
<p>We will also reuse our codes on gradient descent methods from project 1.</p>
<p>The data sets that we propose here are (the default sets)</p>
<ul class="simple">
<li><p>Regression (fitting a continuous function). In this part you will need to bring back your results from project 1 and compare these with what you get from your Neural Network code to be developed here. The data sets could be</p>
<ul>
<li><p>The simple one-dimensional function Runge function from project 1, that is <span class="math notranslate nohighlight">\(f(x) = \frac{1}{1+25x^2}\)</span>. We recommend using a simpler function when developing your neural network code for regression problems. Feel however free to discuss and study other functions, such as the two-dimensional Runge function <span class="math notranslate nohighlight">\(f(x,y)=\left[(10x - 5)^2 + (10y - 5)^2 + 1 \right]^{-1}\)</span>, or even more complicated two-dimensional functions (see the supplementary material of <a class="reference external" href="https://www.nature.com/articles/s41467-025-61362-4">https://www.nature.com/articles/s41467-025-61362-4</a> for an extensive list of two-dimensional functions).</p></li>
</ul>
</li>
<li><p>Classification.</p></li>
<li><p>We will consider a multiclass classification problem given by the full MNIST data set. The full data set is at <a class="reference external" href="https://www.kaggle.com/datasets/hojjatk/mnist-dataset">https://www.kaggle.com/datasets/hojjatk/mnist-dataset</a>.</p></li>
</ul>
<p>We will start with a regression problem and we will reuse our codes on gradient descent methods from project 1.</p>
<section id="part-a-analytical-warm-up">
<h3>Part a): Analytical warm-up<a class="headerlink" href="#part-a-analytical-warm-up" title="Link to this heading">#</a></h3>
<p>When using our gradient machinery from project 1, we will need the expressions for the cost/loss functions and their respective
gradients. The functions whose gradients we need are:</p>
<ol class="arabic simple">
<li><p>The mean-squared error (MSE) with and without the <span class="math notranslate nohighlight">\(L_1\)</span> and <span class="math notranslate nohighlight">\(L_2\)</span> norms (regression problems)</p></li>
<li><p>The binary cross entropy (aka log loss) for binary classification problems with and without <span class="math notranslate nohighlight">\(L_1\)</span> and <span class="math notranslate nohighlight">\(L_2\)</span> norms</p></li>
<li><p>The multiclass cross entropy cost/loss function (aka Softmax cross entropy or just Softmax loss function)</p></li>
</ol>
<p>Set up these three cost/loss functions and their respective derivatives and explain the various terms. In this project you will however only use the MSE and the Softmax cross entropy.</p>
<p>We will test three activation functions for our neural network setup, these are the</p>
<ol class="arabic simple">
<li><p>The Sigmoid (aka <strong>logit</strong>) function,</p></li>
<li><p>the RELU function and</p></li>
<li><p>the Leaky RELU function</p></li>
</ol>
<p>Set up their expressions and their first derivatives.
You may consult the lecture notes (with codes and more) from week 42 at <a class="reference external" href="https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/week42.html">https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/week42.html</a>.</p>
</section>
<section id="reminder-about-the-gradient-machinery-from-project-1">
<h3>Reminder about the gradient machinery from project 1<a class="headerlink" href="#reminder-about-the-gradient-machinery-from-project-1" title="Link to this heading">#</a></h3>
<p>In the setup of a neural network code you will need your gradient descent codes from
project 1. For neural networks we will recommend using stochastic
gradient descent with either the RMSprop or the ADAM algorithms for
updating the learning rates. But you should feel free to try plain gradient descent as well.</p>
<p>We recommend reading chapter 8 on optimization from the textbook of
Goodfellow, Bengio and Courville at
<a class="reference external" href="https://www.deeplearningbook.org/">https://www.deeplearningbook.org/</a>. This chapter contains many
useful insights and discussions on the optimization part of machine
learning. A useful reference on the back progagation algorithm is
Nielsens book at <a class="reference external" href="http://neuralnetworksanddeeplearning.com/">http://neuralnetworksanddeeplearning.com/</a>.</p>
<p>You will find the Python <a class="reference external" href="https://seaborn.pydata.org/generated/seaborn.heatmap.html">Seaborn
package</a>
useful when plotting the results as function of the learning rate
<span class="math notranslate nohighlight">\(\eta\)</span> and the hyper-parameter <span class="math notranslate nohighlight">\(\lambda\)</span> .</p>
</section>
<section id="part-b-writing-your-own-neural-network-code">
<h3>Part b): Writing your own Neural Network code<a class="headerlink" href="#part-b-writing-your-own-neural-network-code" title="Link to this heading">#</a></h3>
<p>Your aim now, and this is the central part of this project, is to
write your own FFNN code implementing the back
propagation algorithm discussed in the lecture slides from week 41 at <a class="reference external" href="https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/week41.html">https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/week41.html</a> and week 42 at <a class="reference external" href="https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/week42.html">https://compphysics.github.io/MachineLearning/doc/LectureNotes/_build/html/week42.html</a>.</p>
<p>We will focus on a regression problem first, using the one-dimensional Runge function</p>
<div class="math notranslate nohighlight">
\[
f(x) = \frac{1}{1+25x^2},
\]</div>
<p>from project 1.</p>
<p>Use only the mean-squared error as cost function (no regularization terms) and
write an FFNN code for a regression problem with a flexible number of hidden
layers and nodes using only the Sigmoid function as activation function for
the hidden layers. Initialize the weights using a normal
distribution. How would you initialize the biases? And which
activation function would you select for the final output layer?
And how would you set up your design/feature matrix? Hint: does it have to represent a polynomial approximation as you did in project 1?</p>
<p>Train your network and compare the results with those from your OLS
regression code from project 1 using the one-dimensional Runge
function. When comparing your neural network code with the OLS
results from project 1, use the same data sets which gave you the best
MSE score. Moreover, use the polynomial order from project 1 that gave you the
best result. Compare these results with your neural network with one
and two hidden layers using <span class="math notranslate nohighlight">\(50\)</span> and <span class="math notranslate nohighlight">\(100\)</span> hidden nodes, respectively.</p>
<p>Comment your results and give a critical discussion of the results
obtained with the OLS code from project 1 and your own neural network
code. Make an analysis of the learning rates employed to find the
optimal MSE score. Test both stochastic gradient descent
with RMSprop and ADAM and plain gradient descent with different
learning rates.</p>
<p>You should, as you did in project 1, scale your data.</p>
</section>
<section id="part-c-testing-against-other-software-libraries">
<h3>Part c): Testing against other software libraries<a class="headerlink" href="#part-c-testing-against-other-software-libraries" title="Link to this heading">#</a></h3>
<p>You should test your results against a similar code using <strong>Scikit-Learn</strong> (see the examples in the above lecture notes from weeks 41 and 42) or <strong>tensorflow/keras</strong> or <strong>Pytorch</strong> (for Pytorch, see Raschka et al.s text chapters 12 and 13).</p>
<p>Furthermore, you should also test that your derivatives are correctly
calculated using automatic differentiation, using for example the
<strong>Autograd</strong> library or the <strong>JAX</strong> library. It is optional to implement
these libraries for the present project. In this project they serve as
useful tests of our derivatives.</p>
</section>
<section id="part-d-testing-different-activation-functions-and-depths-of-the-neural-network">
<h3>Part d): Testing different activation functions and depths of the neural network<a class="headerlink" href="#part-d-testing-different-activation-functions-and-depths-of-the-neural-network" title="Link to this heading">#</a></h3>
<p>You should also test different activation functions for the hidden
layers. Try out the Sigmoid, the RELU and the Leaky RELU functions and
discuss your results. Test your results as functions of the number of hidden layers and nodes. Do you see signs of overfitting?
It is optional in this project to perform a bias-variance trade-off analysis.</p>
</section>
<section id="part-e-testing-different-norms">
<h3>Part e): Testing different norms<a class="headerlink" href="#part-e-testing-different-norms" title="Link to this heading">#</a></h3>
<p>Finally, still using the one-dimensional Runge function, add now the
hyperparameters <span class="math notranslate nohighlight">\(\lambda\)</span> with the <span class="math notranslate nohighlight">\(L_2\)</span> and <span class="math notranslate nohighlight">\(L_1\)</span> norms. Find the
optimal results for the hyperparameters <span class="math notranslate nohighlight">\(\lambda\)</span> and the learning
rates <span class="math notranslate nohighlight">\(\eta\)</span> and neural network architecture and compare the <span class="math notranslate nohighlight">\(L_2\)</span> results with Ridge regression from
project 1 and the <span class="math notranslate nohighlight">\(L_1\)</span> results with the Lasso calculations of project 1.
Use again the same data sets and the best results from project 1 in your comparisons.</p>
</section>
<section id="part-f-classification-analysis-using-neural-networks">
<h3>Part f): Classification analysis using neural networks<a class="headerlink" href="#part-f-classification-analysis-using-neural-networks" title="Link to this heading">#</a></h3>
<p>With a well-written code it should now be easy to change the
activation function for the output layer.</p>
<p>Here we will change the cost function for our neural network code
developed in parts b), d) and e) in order to perform a classification
analysis. The classification problem we will study is the multiclass
MNIST problem, see the description of the full data set at
<a class="reference external" href="https://www.kaggle.com/datasets/hojjatk/mnist-dataset">https://www.kaggle.com/datasets/hojjatk/mnist-dataset</a>. We will use the Softmax cross entropy function discussed in a).
The MNIST data set discussed in the lecture notes from week 42 is a downscaled variant of the full dataset.</p>
<p>Feel free to suggest other data sets. If you find the classic MNIST data set somewhat limited, feel free to try the<br />
MNIST-Fashion data set at for example <a class="reference external" href="https://www.kaggle.com/datasets/zalando-research/fashionmnist">https://www.kaggle.com/datasets/zalando-research/fashionmnist</a>.</p>
<p>To set up the data set, the following python programs may be useful</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>from sklearn.datasets import fetch_openml
# Fetch the MNIST dataset
mnist = fetch_openml(&#39;mnist_784&#39;, version=1, as_frame=False, parser=&#39;auto&#39;)
# Extract data (features) and target (labels)
X = mnist.data
y = mnist.target
</pre></div>
</div>
</div>
</div>
<p>You should consider scaling the data. The Pixel values in MNIST range from 0 to 255. Scaling them to a 0-1 range can improve the performance of some models. That is, you could implement the following scaling</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>X = X / 255.0
</pre></div>
</div>
</div>
</div>
<p>And then perform the standard train-test splitting</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
</pre></div>
</div>
</div>
</div>
<p>To measure the performance of our classification problem we will use the
so-called <em>accuracy</em> score. The accuracy is as you would expect just
the number of correctly guessed targets <span class="math notranslate nohighlight">\(t_i\)</span> divided by the total
number of targets, that is</p>
<div class="math notranslate nohighlight">
\[
\text{Accuracy} = \frac{\sum_{i=1}^n I(t_i = y_i)}{n} ,
\]</div>
<p>where <span class="math notranslate nohighlight">\(I\)</span> is the indicator function, <span class="math notranslate nohighlight">\(1\)</span> if <span class="math notranslate nohighlight">\(t_i = y_i\)</span> and <span class="math notranslate nohighlight">\(0\)</span>
otherwise if we have a binary classification problem. Here <span class="math notranslate nohighlight">\(t_i\)</span>
represents the target and <span class="math notranslate nohighlight">\(y_i\)</span> the outputs of your FFNN code and <span class="math notranslate nohighlight">\(n\)</span> is simply the number of targets <span class="math notranslate nohighlight">\(t_i\)</span>.</p>
<p>Discuss your results and give a critical analysis of the various parameters, including hyper-parameters like the learning rates and the regularization parameter <span class="math notranslate nohighlight">\(\lambda\)</span>, various activation functions, number of hidden layers and nodes and activation functions.</p>
<p>Again, we strongly recommend that you compare your own neural Network
code for classification and pertinent results against a similar code using <strong>Scikit-Learn</strong> or <strong>tensorflow/keras</strong> or <strong>pytorch</strong>.</p>
<p>If you have time, you can use the functionality of <strong>scikit-learn</strong> and compare your neural network results with those from Logistic regression. This is optional.
The weblink here <a class="reference external" href="https://medium.com/ai-in-plain-english/comparison-between-logistic-regression-and-neural-networks-in-classifying-digits-dc5e85cd93c3">https://medium.com/ai-in-plain-english/comparison-between-logistic-regression-and-neural-networks-in-classifying-digits-dc5e85cd93c3</a>compares logistic regression and FFNN using the so-called MNIST data set. You may find several useful hints and ideas from this article. Your neural network code can implement the equivalent of logistic regression by simply setting the number of hidden layers to zero and keeping just the input and the output layers.</p>
<p>If you wish to compare with say Logisti Regression from <strong>scikit-learn</strong>, the following code uses the above data set</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>from sklearn.linear_model import LogisticRegression
# Initialize the model
model = LogisticRegression(solver=&#39;saga&#39;, multi_class=&#39;multinomial&#39;, max_iter=1000, random_state=42)
# Train the model
model.fit(X_train, y_train)
from sklearn.metrics import accuracy_score
# Make predictions on the test set
y_pred = model.predict(X_test)
# Calculate accuracy
accuracy = accuracy_score(y_test, y_pred)
print(f&quot;Model Accuracy: {accuracy:.4f}&quot;)
</pre></div>
</div>
</div>
</div>
</section>
<section id="part-g-critical-evaluation-of-the-various-algorithms">
<h3>Part g) Critical evaluation of the various algorithms<a class="headerlink" href="#part-g-critical-evaluation-of-the-various-algorithms" title="Link to this heading">#</a></h3>
<p>After all these glorious calculations, you should now summarize the
various algorithms and come with a critical evaluation of their pros
and cons. Which algorithm works best for the regression case and which
is best for the classification case. These codes can also be part of
your final project 3, but now applied to other data sets.</p>
</section>
</section>
<section id="summary-of-methods-to-implement-and-analyze">
<h2>Summary of methods to implement and analyze<a class="headerlink" href="#summary-of-methods-to-implement-and-analyze" title="Link to this heading">#</a></h2>
<p><strong>Required Implementation:</strong></p>
<ol class="arabic simple">
<li><p>Reuse the regression code and results from project 1, these will act as a benchmark for seeing how suited a neural network is for this regression task.</p></li>
<li><p>Implement a neural network with</p></li>
</ol>
<ul class="simple">
<li><p>A flexible number of layers</p></li>
<li><p>A flexible number of nodes in each layer</p></li>
<li><p>A changeable activation function in each layer (Sigmoid, ReLU, LeakyReLU, as well as Linear and Softmax)</p></li>
<li><p>A changeable cost function, which will be set to MSE for regression and cross-entropy for multiple-classification</p></li>
<li><p>An optional L1 or L2 norm of the weights and biases in the cost function (only used for computing gradients, not interpretable metrics)</p></li>
</ul>
<ol class="arabic simple" start="3">
<li><p>Implement the back-propagation algorithm to compute the gradient of your neural network</p></li>
<li><p>Reuse the implementation of Plain and Stochastic Gradient Descent from Project 1 (and adapt the code to work with the your neural network)</p></li>
</ol>
<ul class="simple">
<li><p>With no optimization algorithm</p></li>
<li><p>With RMS Prop</p></li>
<li><p>With ADAM</p></li>
</ul>
<ol class="arabic simple" start="5">
<li><p>Implement scaling and train-test splitting of your data, preferably using sklearn</p></li>
<li><p>Implement and compute metrics like the MSE and Accuracy</p></li>
</ol>
<section id="required-analysis">
<h3>Required Analysis:<a class="headerlink" href="#required-analysis" title="Link to this heading">#</a></h3>
<ol class="arabic simple">
<li><p>Briefly show and argue for the advantages and disadvantages of the methods from Project 1.</p></li>
<li><p>Explore and show the impact of changing the number of layers, nodes per layer, choice of activation function, and inclusion of L1 and L2 norms. Present only the most interesting results from this exploration. 2D Heatmaps will be good for this: Start with finding a well performing set of hyper-parameters, then change two at a time in a range that shows good and bad performance.</p></li>
<li><p>Show and argue for the advantages and disadvantages of using a neural network for regression on your data</p></li>
<li><p>Show and argue for the advantages and disadvantages of using a neural network for classification on your data</p></li>
<li><p>Show and argue for the advantages and disadvantages of the different gradient methods and learning rates when training the neural network</p></li>
</ol>
</section>
<section id="optional-note-that-you-should-include-at-least-two-of-these-in-the-report">
<h3>Optional (Note that you should include at least two of these in the report):<a class="headerlink" href="#optional-note-that-you-should-include-at-least-two-of-these-in-the-report" title="Link to this heading">#</a></h3>
<ol class="arabic simple">
<li><p>Implement Logistic Regression as simple classification model case (equivalent to a Neural Network with just the output layer)</p></li>
<li><p>Compute the gradient of the neural network with autograd, to show that it gives the same result as your hand-written backpropagation.</p></li>
<li><p>Compare your results with results from using a machine-learning library like pytorch (<a class="reference external" href="https://docs.pytorch.org/tutorials/beginner/basics/buildmodel_tutorial.html">https://docs.pytorch.org/tutorials/beginner/basics/buildmodel_tutorial.html</a>)</p></li>
<li><p>Use a more complex classification dataset instead, like the fashion MNIST (see <a class="reference external" href="https://www.kaggle.com/datasets/zalando-research/fashionmnist">https://www.kaggle.com/datasets/zalando-research/fashionmnist</a>)</p></li>
<li><p>Use a more complex regression dataset instead, like the two-dimensional Runge function <span class="math notranslate nohighlight">\(f(x,y)=\left[(10x - 5)^2 + (10y - 5)^2 + 1 \right]^{-1}\)</span>, or even more complicated two-dimensional functions (see the supplementary material of <a class="reference external" href="https://www.nature.com/articles/s41467-025-61362-4">https://www.nature.com/articles/s41467-025-61362-4</a> for an extensive list of two-dimensional functions).</p></li>
<li><p>Compute and interpret a confusion matrix of your best classification model (see <a class="reference external" href="https://www.researchgate.net/figure/Confusion-matrix-of-MNIST-and-F-MNIST-embeddings_fig5_349758607">https://www.researchgate.net/figure/Confusion-matrix-of-MNIST-and-F-MNIST-embeddings_fig5_349758607</a>)</p></li>
</ol>
</section>
</section>
<section id="background-literature">
<h2>Background literature<a class="headerlink" href="#background-literature" title="Link to this heading">#</a></h2>
<ol class="arabic simple">
<li><p>The text of Michael Nielsen is highly recommended, see Nielsens book at <a class="reference external" href="http://neuralnetworksanddeeplearning.com/">http://neuralnetworksanddeeplearning.com/</a>. It is an excellent read.</p></li>
<li><p>Goodfellow, Bengio and Courville, Deep Learning at <a class="reference external" href="https://www.deeplearningbook.org/">https://www.deeplearningbook.org/</a>. Here we recommend chapters 6, 7 and 8</p></li>
<li><p>Raschka et al. at <a class="reference external" href="https://sebastianraschka.com/blog/2022/ml-pytorch-book.html">https://sebastianraschka.com/blog/2022/ml-pytorch-book.html</a>. Here we recommend chapters 11, 12 and 13.</p></li>
</ol>
</section>
<section id="introduction-to-numerical-projects">
<h2>Introduction to numerical projects<a class="headerlink" href="#introduction-to-numerical-projects" title="Link to this heading">#</a></h2>
<p>Here follows a brief recipe and recommendation on how to write a report for each
project.</p>
<ul class="simple">
<li><p>Give a short description of the nature of the problem and the eventual numerical methods you have used.</p></li>
<li><p>Describe the algorithm you have used and/or developed. Here you may find it convenient to use pseudocoding. In many cases you can describe the algorithm in the program itself.</p></li>
<li><p>Include the source code of your program. Comment your program properly.</p></li>
<li><p>If possible, try to find analytic solutions, or known limits in order to test your program when developing the code.</p></li>
<li><p>Include your results either in figure form or in a table. Remember to label your results. All tables and figures should have relevant captions and labels on the axes.</p></li>
<li><p>Try to evaluate the reliabilty and numerical stability/precision of your results. If possible, include a qualitative and/or quantitative discussion of the numerical stability, eventual loss of precision etc.</p></li>
<li><p>Try to give an interpretation of you results in your answers to the problems.</p></li>
<li><p>Critique: if possible include your comments and reflections about the exercise, whether you felt you learnt something, ideas for improvements and other thoughts youve made when solving the exercise. We wish to keep this course at the interactive level and your comments can help us improve it.</p></li>
<li><p>Try to establish a practice where you log your work at the computerlab. You may find such a logbook very handy at later stages in your work, especially when you dont properly remember what a previous test version of your program did. Here you could also record the time spent on solving the exercise, various algorithms you may have tested or other topics which you feel worthy of mentioning.</p></li>
</ul>
</section>
<section id="format-for-electronic-delivery-of-report-and-programs">
<h2>Format for electronic delivery of report and programs<a class="headerlink" href="#format-for-electronic-delivery-of-report-and-programs" title="Link to this heading">#</a></h2>
<p>The preferred format for the report is a PDF file. You can also use DOC or postscript formats or as an ipython notebook file. As programming language we prefer that you choose between C/C++, Fortran2008 or Python. The following prescription should be followed when preparing the report:</p>
<ul class="simple">
<li><p>Use Canvas to hand in your projects, log in at <a class="reference external" href="https://www.uio.no/english/services/it/education/canvas/">https://www.uio.no/english/services/it/education/canvas/</a> with your normal UiO username and password.</p></li>
<li><p>Upload <strong>only</strong> the report file or the link to your GitHub/GitLab or similar typo of repos! For the source code file(s) you have developed please provide us with your link to your GitHub/GitLab or similar domain. The report file should include all of your discussions and a list of the codes you have developed. Do not include library files which are available at the course homepage, unless you have made specific changes to them.</p></li>
<li><p>In your GitHub/GitLab or similar repository, please include a folder which contains selected results. These can be in the form of output from your code for a selected set of runs and input parameters.</p></li>
</ul>
<p>Finally,
we encourage you to collaborate. Optimal working groups consist of
2-3 students. You can then hand in a common report.</p>
</section>
</section>
<script type="text/x-thebe-config">
{
requestKernel: true,
binderOptions: {
repo: "binder-examples/jupyter-stacks-datascience",
ref: "master",
},
codeMirrorConfig: {
theme: "abcdef",
mode: "python"
},
kernelOptions: {
name: "python3",
path: "./."
},
predefinedOutput: true
}
</script>
<script>kernelName = 'python3'</script>
</article>
<footer class="prev-next-footer d-print-none">
<div class="prev-next-area">
<a class="left-prev"
href="project1.html"
title="previous page">
<i class="fa-solid fa-angle-left"></i>
<div class="prev-next-info">
<p class="prev-next-subtitle">previous</p>
<p class="prev-next-title">Project 1 on Machine Learning, deadline October 6 (midnight), 2025</p>
</div>
</a>
</div>
</footer>
</div>
<div class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner">
<div class="sidebar-secondary-item">
<div class="page-toc tocsection onthispage">
<i class="fa-solid fa-list"></i> Contents
</div>
<nav class="bd-toc-nav page-toc">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#deliverables">Deliverables</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#preamble-note-on-writing-reports-using-reference-material-ai-and-other-tools">Preamble: Note on writing reports, using reference material, AI and other tools</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#classification-and-regression-writing-our-own-neural-network-code">Classification and Regression, writing our own neural network code</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-a-analytical-warm-up">Part a): Analytical warm-up</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#reminder-about-the-gradient-machinery-from-project-1">Reminder about the gradient machinery from project 1</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-b-writing-your-own-neural-network-code">Part b): Writing your own Neural Network code</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-c-testing-against-other-software-libraries">Part c): Testing against other software libraries</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-d-testing-different-activation-functions-and-depths-of-the-neural-network">Part d): Testing different activation functions and depths of the neural network</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-e-testing-different-norms">Part e): Testing different norms</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-f-classification-analysis-using-neural-networks">Part f): Classification analysis using neural networks</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#part-g-critical-evaluation-of-the-various-algorithms">Part g) Critical evaluation of the various algorithms</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#summary-of-methods-to-implement-and-analyze">Summary of methods to implement and analyze</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#required-analysis">Required Analysis:</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#optional-note-that-you-should-include-at-least-two-of-these-in-the-report">Optional (Note that you should include at least two of these in the report):</a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#background-literature">Background literature</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#introduction-to-numerical-projects">Introduction to numerical projects</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#format-for-electronic-delivery-of-report-and-programs">Format for electronic delivery of report and programs</a></li>
</ul>
</nav></div>
</div></div>
</div>
<footer class="bd-footer-content">
<div class="bd-footer-content__inner container">
<div class="footer-item">
<p class="component-author">
By Morten Hjorth-Jensen
</p>
</div>
<div class="footer-item">
<p class="copyright">
© Copyright 2023.
<br/>
</p>
</div>
<div class="footer-item">
</div>
<div class="footer-item">
</div>
</div>
</footer>
</main>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="_static/scripts/bootstrap.js?digest=dfe6caa3a7d634c4db9b"></script>
<script src="_static/scripts/pydata-sphinx-theme.js?digest=dfe6caa3a7d634c4db9b"></script>
<footer class="bd-footer">
</footer>
</body>
</html>