This repository has been archived on 2023-12-10. You can view files and clone it, but cannot push or open issues or pull requests.
mmp-site/public/posts/week-6/index.html
2022-03-28 16:46:12 +01:00

322 lines
7.8 KiB
HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta name="generator" content="Hugo 0.95.0" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="This week I finished programming the basic CNN model using transfer learning. I decided to train it for 20 epochs to make sure there weren&rsquo;t any runtime errors in my code. As I don&rsquo;t own an Nvidia GPU (I have an AMD GPU), I couldn&rsquo;t make use of the pytorch version that utilised CUDA to speed up processing. There is a RocM version of pytorch for AMD GPUs1 but RocM isn&rsquo;t as mature as CUDA and only officially supports a small subset of Linux distributions.">
<meta name="theme-color" content="#FFFFFF"><meta property="og:title" content="Week 6" />
<meta property="og:description" content="This week I finished programming the basic CNN model using transfer learning. I decided to train it for 20 epochs to make sure there weren&rsquo;t any runtime errors in my code. As I don&rsquo;t own an Nvidia GPU (I have an AMD GPU), I couldn&rsquo;t make use of the pytorch version that utilised CUDA to speed up processing. There is a RocM version of pytorch for AMD GPUs1 but RocM isn&rsquo;t as mature as CUDA and only officially supports a small subset of Linux distributions." />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://mmp.oscar.blue/posts/week-6/" /><meta property="article:section" content="posts" />
<meta property="article:published_time" content="2022-03-13T12:40:17+01:00" />
<meta property="article:modified_time" content="2022-03-13T12:40:17+01:00" />
<title>Week 6 | MMP | Oscar Pocock</title>
<link rel="manifest" href="/manifest.json">
<link rel="icon" href="/favicon.png" type="image/x-icon">
<link rel="stylesheet" href="/book.min.68be0b7a9674f2a612ce0e9b2e9447ff4b7ac96546e06b642bfd3ded0ca490ef.css" integrity="sha256-aL4LepZ08qYSzg6bLpRH/0t6yWVG4GtkK/097QykkO8=">
<script defer src="/en.search.min.6bd18a0f048eff9ca273fd5ac40fe7159f145a30edf28a0847cab90265bd241a.js" integrity="sha256-a9GKDwSO/5yic/1axA/nFZ8UWjDt8ooIR8q5AmW9JBo="></script>
<script defer src="/sw.min.6f6f90fcb8eb1c49ec389838e6b801d0de19430b8e516902f8d75c3c8bd98739.js" integrity="sha256-b2&#43;Q/LjrHEnsOJg45rgB0N4ZQwuOUWkC&#43;NdcPIvZhzk="></script>
<!--
Made with Book Theme
https://github.com/alex-shpak/hugo-book
-->
</head>
<body dir="ltr">
<input type="checkbox" class="hidden toggle" id="menu-control" />
<input type="checkbox" class="hidden toggle" id="toc-control" />
<main class="container flex">
<aside class="book-menu">
<div class="book-menu-content">
<nav>
<h2 class="book-brand">
<a href="/"><span>MMP | Oscar Pocock</span>
</a>
</h2>
<div class="book-search">
<input type="text" id="book-search-input" placeholder="Search" aria-label="Search" maxlength="64" data-hotkeys="s/" />
<div class="book-search-spinner hidden"></div>
<ul id="book-search-results"></ul>
</div>
<ul>
<li class="book-section-flat" >
<a href="https://mmp.oscar.blue/docs/developer/" class="">Developer Documentation</a>
<ul>
</ul>
</li>
<li class="book-section-flat" >
<a href="https://mmp.oscar.blue/docs/user/" class="">User Documentation</a>
<ul>
</ul>
</li>
</ul>
<ul>
<li>
<a href="/posts/" >
Blog
</a>
</li>
<li>
<a href="https://teaching.dcs.aber.ac.uk/mmp" target="_blank" rel="noopener">
Aberystwyth MMP Site
</a>
</li>
<li>
<a href="https://git.oscar.blue" target="_blank" rel="noopener">
Source Code
</a>
</li>
</ul>
</nav>
<script>(function(){var e=document.querySelector("aside.book-menu nav");addEventListener("beforeunload",function(){localStorage.setItem("menu.scrollTop",e.scrollTop)}),e.scrollTop=localStorage.getItem("menu.scrollTop")})()</script>
</div>
</aside>
<div class="book-page">
<header class="book-header">
<div class="flex align-center justify-between">
<label for="menu-control">
<img src="/svg/menu.svg" class="book-icon" alt="Menu" />
</label>
<strong>Week 6</strong>
<label for="toc-control">
<img src="/svg/toc.svg" class="book-icon" alt="Table of Contents" />
</label>
</div>
<aside class="hidden clearfix">
<nav id="TableOfContents">
<ul>
<li>
<ul>
<li><a href="#transfer-learning-model-architecture">Transfer learning model architecture</a>
<ul>
<li><a href="#full">Full</a></li>
<li><a href="#simplified">Simplified</a></li>
</ul>
</li>
<li><a href="#validation-and-train-loss-over-20-epochs">Validation and train loss over 20 epochs</a></li>
</ul>
</li>
</ul>
</nav>
</aside>
</header>
<article class="markdown">
<h1>
<a href="/posts/week-6/">Week 6</a>
</h1>
<h5>March 13, 2022</h5>
<p>This week I finished programming the basic CNN model using transfer learning. I decided to train it for 20 epochs to make sure there weren&rsquo;t any runtime errors in my code. As I don&rsquo;t own an Nvidia GPU (I have an AMD GPU), I couldn&rsquo;t make use of the pytorch version that utilised CUDA to speed up processing. There is a RocM version of pytorch for AMD GPUs<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> but RocM isn&rsquo;t as mature as CUDA and only officially supports a small subset of Linux distributions. Therefore, for this model I trained on the COU for only 20 epochs just to make sure it ran successfully before trying to find some Nvidia compute.</p>
<h2 id="transfer-learning-model-architecture">
Transfer learning model architecture
<a class="anchor" href="#transfer-learning-model-architecture">#</a>
</h2>
<h3 id="full">
Full
<a class="anchor" href="#full">#</a>
</h3>
<p>
<img src="/transfer-cnn-arch.svg" alt="Transfer learning architecture" /></p>
<h3 id="simplified">
Simplified
<a class="anchor" href="#simplified">#</a>
</h3>
<p>
<img src="/transfer-cnn-arch-simpl.svg" alt="Simplified Transfer learning architecture" /></p>
<h2 id="validation-and-train-loss-over-20-epochs">
Validation and train loss over 20 epochs
<a class="anchor" href="#validation-and-train-loss-over-20-epochs">#</a>
</h2>
<p>
<img src="/20-epoch-plot.png" alt="plot of training and validation loss over 20 epochs" /></p>
<section class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1" role="doc-endnote">
<p>
<a href="https://pytorch.org/blog/pytorch-for-amd-rocm-platform-now-available-as-python-package/">https://pytorch.org/blog/pytorch-for-amd-rocm-platform-now-available-as-python-package/</a>&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</section>
</article>
<footer class="book-footer">
<div class="flex flex-wrap justify-between">
</div>
</footer>
<div class="book-comments">
</div>
<label for="menu-control" class="hidden book-menu-overlay"></label>
</div>
<aside class="book-toc">
<div class="book-toc-content">
<nav id="TableOfContents">
<ul>
<li>
<ul>
<li><a href="#transfer-learning-model-architecture">Transfer learning model architecture</a>
<ul>
<li><a href="#full">Full</a></li>
<li><a href="#simplified">Simplified</a></li>
</ul>
</li>
<li><a href="#validation-and-train-loss-over-20-epochs">Validation and train loss over 20 epochs</a></li>
</ul>
</li>
</ul>
</nav>
</div>
</aside>
</main>
</body>
</html>