{"id":5646664,"date":"2022-09-20T18:19:58","date_gmt":"2022-09-20T22:19:58","guid":{"rendered":"https:\/\/lightning.ai\/pages\/?p=5646664"},"modified":"2022-11-09T14:43:04","modified_gmt":"2022-11-09T19:43:04","slug":"introduction-to-coding-neural-networks-with-pytorch-lightning","status":"publish","type":"post","link":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/","title":{"rendered":"Introduction to Coding Neural Networks with PyTorch + Lightning"},"content":{"rendered":"<h2>A StatQuest Jupyter Notebook<\/h2>\n<p>Although we saw how to code a simple neural network with PyTorch in <a class=\"notion-link-token notion-enable-hover\" href=\"https:\/\/youtu.be\/FHdlXe1bSe4\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"1\" data-reactroot=\"\"><span class=\"link-annotation-unknown-block-id--898723989\">The StatQuest Introduction to PyTorch<\/span><\/a>, we can make our lives a lot easier if we add Lightning to the mix. It makes writing the code easier, makes it portable to different computing environments and can even find the learning rate for us! Here we have the the Jupyter Notebook based on the <a class=\"notion-link-token notion-enable-hover\" href=\"https:\/\/youtu.be\/khMzi6xPbuM\" target=\"_blank\" rel=\"noopener noreferrer\" data-token-index=\"3\" data-reactroot=\"\"><span class=\"link-annotation-unknown-block-id-1808514780\">Introduction to Coding Neural Networks with PyTorch + Lightning<\/span><\/a>. TRIPLE BAM!!!<br \/>\n<\/br><\/br><\/p>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/khMzi6xPbuM\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><script charset=\"utf-8\" type=\"text\/javascript\" src=\"\/\/js.hsforms.net\/forms\/v2.js\"><\/script><br \/>\n<script data-hubspot-rendered=\"true\">hbspt.forms.create({region:\"na1\",portalId:\"9067487\",formId:\"2494df4e-fdbc-4162-aa04-b97b9144ea0d\",version:\"V2_PRERELEASE\"});<\/script><\/p>\n<div class=\"hbspt-form\" id=\"hbspt-form-1668022699733-7826541328\"><iframe title=\"Form 0\" id=\"hs-form-iframe-0\" class=\"hs-form-iframe\" scrolling=\"no\" width=\"100%\" style=\"width: 100%; position: static; border: none; display: block; overflow: hidden; height: 372px;\" height=\"372\"><\/iframe><\/div>\n","protected":false},"excerpt":{"rendered":"<p>A StatQuest Jupyter Notebook Although we saw how to code a simple neural network with PyTorch in The StatQuest Introduction to PyTorch, we can make our lives a lot easier if we add Lightning to the mix. It makes writing the code easier, makes it portable to different computing environments and can even find the<a class=\"excerpt-read-more\" href=\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/\" title=\"ReadIntroduction to Coding Neural Networks with PyTorch + Lightning\">&#8230; Read more &raquo;<\/a><\/p>\n","protected":false},"author":16,"featured_media":5646666,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[76],"tags":[],"glossary":[],"acf":{"hide_from_archive":null,"content_type":null,"code_embed":null,"code_shortcode":null,"custom_styles":null,"sticky":null,"additional_authors":null,"mathjax":null,"default_editor":null,"sections":null,"show_table_of_contents":null,"table_of_contents":null,"tabs":null,"tab_group":null},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Introduction to Coding Neural Networks with PyTorch + Lightning<\/title>\n<meta name=\"description\" content=\"Here we have the the Jupyter Notebook based on the Introduction to Coding Neural Networks with PyTorch + Lightning. TRIPLE BAM!!!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introduction to Coding Neural Networks with PyTorch + Lightning\" \/>\n<meta property=\"og:description\" content=\"Here we have the the Jupyter Notebook based on the Introduction to Coding Neural Networks with PyTorch + Lightning. TRIPLE BAM!!!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/\" \/>\n<meta property=\"og:site_name\" content=\"Lightning AI\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-20T22:19:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-09T19:43:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"JP Hennessy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Introduction to Coding Neural Networks with PyTorch + Lightning\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png\" \/>\n<meta name=\"twitter:creator\" content=\"@LightningAI\" \/>\n<meta name=\"twitter:site\" content=\"@LightningAI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"JP Hennessy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/\"},\"author\":{\"name\":\"JP Hennessy\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6\"},\"headline\":\"Introduction to Coding Neural Networks with PyTorch + Lightning\",\"datePublished\":\"2022-09-20T22:19:58+00:00\",\"dateModified\":\"2022-11-09T19:43:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/\"},\"wordCount\":87,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png\",\"articleSection\":[\"Education\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/\",\"url\":\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/\",\"name\":\"Introduction to Coding Neural Networks with PyTorch + Lightning\",\"isPartOf\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png\",\"datePublished\":\"2022-09-20T22:19:58+00:00\",\"dateModified\":\"2022-11-09T19:43:04+00:00\",\"description\":\"Here we have the the Jupyter Notebook based on the Introduction to Coding Neural Networks with PyTorch + Lightning. TRIPLE BAM!!!\",\"breadcrumb\":{\"@id\":\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#primaryimage\",\"url\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png\",\"contentUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/lightning.ai\/pages\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Introduction to Coding Neural Networks with PyTorch + Lightning\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/lightning.ai\/pages\/#website\",\"url\":\"https:\/\/lightning.ai\/pages\/\",\"name\":\"Lightning AI\",\"description\":\"The platform for teams to build AI.\",\"publisher\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/lightning.ai\/pages\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\",\"name\":\"Lightning AI\",\"url\":\"https:\/\/lightning.ai\/pages\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png\",\"contentUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png\",\"width\":1744,\"height\":856,\"caption\":\"Lightning AI\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/LightningAI\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6\",\"name\":\"JP Hennessy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g\",\"caption\":\"JP Hennessy\"},\"url\":\"https:\/\/lightning.ai\/pages\/author\/jplightning-ai\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Introduction to Coding Neural Networks with PyTorch + Lightning","description":"Here we have the the Jupyter Notebook based on the Introduction to Coding Neural Networks with PyTorch + Lightning. TRIPLE BAM!!!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/","og_locale":"en_US","og_type":"article","og_title":"Introduction to Coding Neural Networks with PyTorch + Lightning","og_description":"Here we have the the Jupyter Notebook based on the Introduction to Coding Neural Networks with PyTorch + Lightning. TRIPLE BAM!!!","og_url":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/","og_site_name":"Lightning AI","article_published_time":"2022-09-20T22:19:58+00:00","article_modified_time":"2022-11-09T19:43:04+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png","type":"image\/png"}],"author":"JP Hennessy","twitter_card":"summary_large_image","twitter_title":"Introduction to Coding Neural Networks with PyTorch + Lightning","twitter_image":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png","twitter_creator":"@LightningAI","twitter_site":"@LightningAI","twitter_misc":{"Written by":"JP Hennessy","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#article","isPartOf":{"@id":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/"},"author":{"name":"JP Hennessy","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6"},"headline":"Introduction to Coding Neural Networks with PyTorch + Lightning","datePublished":"2022-09-20T22:19:58+00:00","dateModified":"2022-11-09T19:43:04+00:00","mainEntityOfPage":{"@id":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/"},"wordCount":87,"commentCount":0,"publisher":{"@id":"https:\/\/lightning.ai\/pages\/#organization"},"image":{"@id":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#primaryimage"},"thumbnailUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png","articleSection":["Education"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/","url":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/","name":"Introduction to Coding Neural Networks with PyTorch + Lightning","isPartOf":{"@id":"https:\/\/lightning.ai\/pages\/#website"},"primaryImageOfPage":{"@id":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#primaryimage"},"image":{"@id":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#primaryimage"},"thumbnailUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png","datePublished":"2022-09-20T22:19:58+00:00","dateModified":"2022-11-09T19:43:04+00:00","description":"Here we have the the Jupyter Notebook based on the Introduction to Coding Neural Networks with PyTorch + Lightning. TRIPLE BAM!!!","breadcrumb":{"@id":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#primaryimage","url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png","contentUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/building_nns_with_pytorch_lightning_pt1_v2_thumbnail.001.png","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/lightning.ai\/pages\/education\/introduction-to-coding-neural-networks-with-pytorch-lightning\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/lightning.ai\/pages\/"},{"@type":"ListItem","position":2,"name":"Introduction to Coding Neural Networks with PyTorch + Lightning"}]},{"@type":"WebSite","@id":"https:\/\/lightning.ai\/pages\/#website","url":"https:\/\/lightning.ai\/pages\/","name":"Lightning AI","description":"The platform for teams to build AI.","publisher":{"@id":"https:\/\/lightning.ai\/pages\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lightning.ai\/pages\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/lightning.ai\/pages\/#organization","name":"Lightning AI","url":"https:\/\/lightning.ai\/pages\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/","url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png","contentUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png","width":1744,"height":856,"caption":"Lightning AI"},"image":{"@id":"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/LightningAI"]},{"@type":"Person","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6","name":"JP Hennessy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g","caption":"JP Hennessy"},"url":"https:\/\/lightning.ai\/pages\/author\/jplightning-ai\/"}]}},"_links":{"self":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts\/5646664"}],"collection":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/comments?post=5646664"}],"version-history":[{"count":0,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts\/5646664\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/media\/5646666"}],"wp:attachment":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/media?parent=5646664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/categories?post=5646664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/tags?post=5646664"},{"taxonomy":"glossary","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/glossary?post=5646664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}