{"id":42,"date":"2024-11-06T14:40:32","date_gmt":"2024-11-06T14:40:32","guid":{"rendered":"https:\/\/kindsonthegenius.com\/pytorch\/?p=42"},"modified":"2024-11-06T14:40:32","modified_gmt":"2024-11-06T14:40:32","slug":"pytorch-tutorial-getting-started-with-pytorch","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/","title":{"rendered":"PyTorch Tutorial &#8211; Getting Started with PyTorch"},"content":{"rendered":"<p>This is the first in the series of simplified tutorial on PyTorch.<\/p>\n<h4><strong>What is PyTorch?<\/strong><\/h4>\n<p>PyTorch is a <a href=\"https:\/\/kindsonthegenius.com\/blog\/ai-machine-learning-and-data-science-tutorials\/\" target=\"_blank\" rel=\"noopener\">Machine Learning<\/a> library that is based on the Torch library developed in FaceBook (Meta AI). It is used for developing models for Natural Language Processing and Computer Vision.<\/p>\n<p>PyTorch is a leading <a href=\"https:\/\/kindsonthegenius.com\/blog\/what-is-the-difference-between-machine-learning-and-deep-learning-2\/\" target=\"_blank\" rel=\"noopener\">Deep Learning<\/a> framework similar to <a href=\"https:\/\/kindsonthegenius.com\/blog\/what-the-heck-is-tensorflow-beginner-tutorial-1\/\" target=\"_blank\" rel=\"noopener\">TensorFlow<\/a>. Some of the existing deep learning applications are build on top of PyTorch. These include PyTorch Lightning, Uber&#8217;s Pyro, Tesla AutoPilot and Hugging Face&#8217;s Transformers.<\/p>\n<p>At a high level, PyTorch provides the following features:<\/p>\n<ul>\n<li>Deep Neural Networks<\/li>\n<li>Tensor Computing with GPUs<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h5><strong>PyTorch Tensors<\/strong><\/h5>\n<p>PyTorch provides the torch.tensor class which enables storing and performing operations on multidimensional arrays (Tensors). Tensors are similar to Numpy arrays but can also be operated on a GPU (Graphics Processing Unit)<\/p>\n<h5><strong>PyTorch Neural Networks<\/strong><\/h5>\n<p>PyTorch defines the torch.nn module for building neural network models. This module provides a comprehensive collection of building blocks for neural networks. This includes layers and activation functions.<\/p>\n<p>To create a neural network, you would need to extend the <strong><em>torch.nn<\/em><\/strong> module and override the <strong><em>forward()<\/em><\/strong> function which defines a sequence of operations.<\/p>\n<p>&nbsp;<\/p>\n<h4><strong>Benefits of PyTorch<\/strong><\/h4>\n<p>PyTorch offers the following benefits:<\/p>\n<ul>\n<li><strong>Integration With <a href=\"https:\/\/kindsonthegenius.com\/python\" target=\"_blank\" rel=\"noopener\">Python<\/a><\/strong> &#8211; PyTorch is written in Python and can seamlessly integrate with well-known Python libraries including Numpy for numeric operations, Cython for compiling Python to C and SciPy.<\/li>\n<li><strong>Cloud Support<\/strong> &#8211; PyTorch is supported in major cloud platforms including AWS, Azure and Google Cloud.<\/li>\n<li><strong>Support for GPU<\/strong> and parallel processing<\/li>\n<li><strong>PyTorch Hub<\/strong> &#8211; this is a repository of pre-trained models that can easily be invoked.<\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-understanding-computational-graph\/\" target=\"_blank\" rel=\"noopener\"><strong>Dynamic Computational Graph<\/strong><\/a> &#8211; PyTorch provides support for dynamic computational graph which allows the behaviour of the network to change at runtime.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This is the first in the series of simplified tutorial on PyTorch. What is PyTorch? PyTorch is a Machine Learning library that is based on &hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":""},"categories":[78],"tags":[],"class_list":["post-42","post","type-post","status-publish","format-standard","hentry","category-pytorch-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PyTorch Tutorial - Getting Started with PyTorch - PyTorch Simplified Tutorial<\/title>\n<meta name=\"description\" content=\"In this tutorial, you will learn about PyTorch, what it is, it&#039;s feature as well as the benefits of PyTorch.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PyTorch Tutorial - Getting Started with PyTorch - PyTorch Simplified Tutorial\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you will learn about PyTorch, what it is, it&#039;s feature as well as the benefits of PyTorch.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/\" \/>\n<meta property=\"og:site_name\" content=\"PyTorch Simplified Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-06T14:40:32+00:00\" \/>\n<meta name=\"author\" content=\"Kindson Munonye\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kindson Munonye\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/pytorch-tutorial-getting-started-with-pytorch\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/pytorch-tutorial-getting-started-with-pytorch\\\/\"},\"author\":{\"name\":\"Kindson Munonye\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/#\\\/schema\\\/person\\\/2b1e3e1f9e5335a8493d437c3c835c66\"},\"headline\":\"PyTorch Tutorial &#8211; Getting Started with PyTorch\",\"datePublished\":\"2024-11-06T14:40:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/pytorch-tutorial-getting-started-with-pytorch\\\/\"},\"wordCount\":297,\"commentCount\":0,\"articleSection\":[\"PyTorch Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/pytorch-tutorial-getting-started-with-pytorch\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/pytorch-tutorial-getting-started-with-pytorch\\\/\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/pytorch-tutorial-getting-started-with-pytorch\\\/\",\"name\":\"PyTorch Tutorial - Getting Started with PyTorch - PyTorch Simplified Tutorial\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/#website\"},\"datePublished\":\"2024-11-06T14:40:32+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/#\\\/schema\\\/person\\\/2b1e3e1f9e5335a8493d437c3c835c66\"},\"description\":\"In this tutorial, you will learn about PyTorch, what it is, it's feature as well as the benefits of PyTorch.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/pytorch-tutorial-getting-started-with-pytorch\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/pytorch-tutorial-getting-started-with-pytorch\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/pytorch-tutorial-getting-started-with-pytorch\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PyTorch Tutorial &#8211; Getting Started with PyTorch\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/#website\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/\",\"name\":\"PyTorch Simplified Tutorial\",\"description\":\"Learn how to build deep learning models with Pytorch\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/#\\\/schema\\\/person\\\/2b1e3e1f9e5335a8493d437c3c835c66\",\"name\":\"Kindson Munonye\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b0f9291f0924a109c2372c345a86a4059732be59aad1f8795a216f0b96f855b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b0f9291f0924a109c2372c345a86a4059732be59aad1f8795a216f0b96f855b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3b0f9291f0924a109c2372c345a86a4059732be59aad1f8795a216f0b96f855b?s=96&d=mm&r=g\",\"caption\":\"Kindson Munonye\"},\"sameAs\":[\"http:\\\/\\\/www.kindsonthegeniuscom\"],\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/pytorch\\\/author\\\/kindsonthegenius\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PyTorch Tutorial - Getting Started with PyTorch - PyTorch Simplified Tutorial","description":"In this tutorial, you will learn about PyTorch, what it is, it's feature as well as the benefits of PyTorch.","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:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/","og_locale":"en_US","og_type":"article","og_title":"PyTorch Tutorial - Getting Started with PyTorch - PyTorch Simplified Tutorial","og_description":"In this tutorial, you will learn about PyTorch, what it is, it's feature as well as the benefits of PyTorch.","og_url":"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/","og_site_name":"PyTorch Simplified Tutorial","article_published_time":"2024-11-06T14:40:32+00:00","author":"Kindson Munonye","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kindson Munonye","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/#article","isPartOf":{"@id":"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/"},"author":{"name":"Kindson Munonye","@id":"https:\/\/kindsonthegenius.com\/pytorch\/#\/schema\/person\/2b1e3e1f9e5335a8493d437c3c835c66"},"headline":"PyTorch Tutorial &#8211; Getting Started with PyTorch","datePublished":"2024-11-06T14:40:32+00:00","mainEntityOfPage":{"@id":"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/"},"wordCount":297,"commentCount":0,"articleSection":["PyTorch Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/","url":"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/","name":"PyTorch Tutorial - Getting Started with PyTorch - PyTorch Simplified Tutorial","isPartOf":{"@id":"https:\/\/kindsonthegenius.com\/pytorch\/#website"},"datePublished":"2024-11-06T14:40:32+00:00","author":{"@id":"https:\/\/kindsonthegenius.com\/pytorch\/#\/schema\/person\/2b1e3e1f9e5335a8493d437c3c835c66"},"description":"In this tutorial, you will learn about PyTorch, what it is, it's feature as well as the benefits of PyTorch.","breadcrumb":{"@id":"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kindsonthegenius.com\/pytorch\/pytorch-tutorial-getting-started-with-pytorch\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kindsonthegenius.com\/pytorch\/"},{"@type":"ListItem","position":2,"name":"PyTorch Tutorial &#8211; Getting Started with PyTorch"}]},{"@type":"WebSite","@id":"https:\/\/kindsonthegenius.com\/pytorch\/#website","url":"https:\/\/kindsonthegenius.com\/pytorch\/","name":"PyTorch Simplified Tutorial","description":"Learn how to build deep learning models with Pytorch","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kindsonthegenius.com\/pytorch\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/kindsonthegenius.com\/pytorch\/#\/schema\/person\/2b1e3e1f9e5335a8493d437c3c835c66","name":"Kindson Munonye","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3b0f9291f0924a109c2372c345a86a4059732be59aad1f8795a216f0b96f855b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3b0f9291f0924a109c2372c345a86a4059732be59aad1f8795a216f0b96f855b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3b0f9291f0924a109c2372c345a86a4059732be59aad1f8795a216f0b96f855b?s=96&d=mm&r=g","caption":"Kindson Munonye"},"sameAs":["http:\/\/www.kindsonthegeniuscom"],"url":"https:\/\/kindsonthegenius.com\/pytorch\/author\/kindsonthegenius\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/pytorch\/wp-json\/wp\/v2\/posts\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/pytorch\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/pytorch\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/pytorch\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/pytorch\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":4,"href":"https:\/\/kindsonthegenius.com\/pytorch\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"predecessor-version":[{"id":330,"href":"https:\/\/kindsonthegenius.com\/pytorch\/wp-json\/wp\/v2\/posts\/42\/revisions\/330"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/pytorch\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/pytorch\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/pytorch\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}