{"id":58027,"date":"2022-01-26T12:26:29","date_gmt":"2022-01-26T11:26:29","guid":{"rendered":"https:\/\/eiposgrados.com\/?p=58027"},"modified":"2022-01-26T12:27:16","modified_gmt":"2022-01-26T11:27:16","slug":"pytorch-keras-tensorflow","status":"publish","type":"post","link":"https:\/\/eiposgrados.com\/eng\/python-blog\/pytorch-keras-tensorflow\/","title":{"rendered":"Pytorch vs Keras vs Tensorflow"},"content":{"rendered":"<p>Python is one of the most used languages. It has abundant libraries and frameworks, specific for Data Science.&nbsp;<\/p>\n\n\n\n<p>We are going to carry out a brief analysis of the main frameworks: Pytorch, Keras and Tensorflow. These \u201cframeworks\u201d allow complex models to be developed with little code.<\/p>\n\n\n\n<h2 class=\"gb-headline gb-headline-51045350 gb-headline-text\"><strong>KERAS<\/strong><\/h2>\n\n\n\n<p>Keras was developed in 2015 by a Google researcher. This framework is very popular and is <strong>inspired<\/strong>or, to a large extent, <strong>scikit-learn<\/strong>. Keras, what is <strong>very easy to use<\/strong>, but it lacked some functionality for advanced models. For that reason, months after Keras, <strong>Google published TensorFlow.<\/strong><\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-pytorch-1-1024x665.jpg\" alt=\"Python Framework Pytorch (1)\" class=\"wp-image-58031\" width=\"393\" height=\"255\" title=\"\" srcset=\"https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-pytorch-1-1024x665.jpg 1024w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-pytorch-1-300x195.jpg 300w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-pytorch-1-768x499.jpg 768w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-pytorch-1-254x165.jpg 254w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-pytorch-1-123x80.jpg 123w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-pytorch-1-200x130.jpg 200w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-pytorch-1.jpg 1310w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"gb-headline gb-headline-702cacf5 gb-headline-text\"><strong>TENSORFLOW<\/strong><\/h2>\n\n\n\n<p>It quickly became a reference framework for <strong>Deep Learning<\/strong>. It allows us to use Keras, which gives it a certain advantage over other environments. Tensorflow has functionalities <strong>deep learning<\/strong>, specially for <strong>complex neural networks<\/strong>.&nbsp;<\/p>\n\n\n\n<p>However, Tensorflow, although it gave access to those functions, was very <strong>complicated for beginners<\/strong>. The updates to these \u201cframeworks\u201d have approximated their modes of operation; Tensorflow uses many of the <strong>Keras API,<\/strong> That is, both work together.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-keras-1-1024x683.jpg\" alt=\"Python Keras Framework (1)\" class=\"wp-image-58032\" width=\"413\" height=\"275\" title=\"\" srcset=\"https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-keras-1-1024x683.jpg 1024w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-keras-1-300x200.jpg 300w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-keras-1-768x512.jpg 768w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-keras-1-247x165.jpg 247w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-keras-1-123x82.jpg 123w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-keras-1-200x133.jpg 200w, https:\/\/eiposgrados.com\/wp-content\/uploads\/2022\/01\/framework-python-keras-1.jpg 1058w\" sizes=\"(max-width: 413px) 100vw, 413px\" \/><\/figure><\/div>\n\n\n\n<h2 class=\"gb-headline gb-headline-e8dd5bea gb-headline-text\"><strong>PYTORCH<\/strong><\/h2>\n\n\n\n<p>PyTorch is a \u201cframework\u201d of <strong>Open Source<\/strong>. It allows us to accelerate the developments of \u201c<strong>Machine Learning<\/strong>\u201d. PyTorch developed in 2016 by <strong>Facebook in \u201copen source\u201d<\/strong>. In 2018 <strong>merged with Caffe2 <\/strong>(another Python framework) and improved performance a lot; especially in speed of execution.<\/p>\n\n\n\n<p>PyTorch <strong>solves Keras and Tensorflow problems<\/strong>- It is easy to customize and allows you to create advanced and innovative networks. From my point of view, PyTorch has advantages in terms of <strong>speed and flexibility <\/strong>so I&#039;m going to analyze some of those advantages.&nbsp;<\/p>\n\n\n\n<h3 class=\"gb-headline gb-headline-865fe953 gb-headline-text\">ADVANTAGES OF PYTORCH<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>In PYTORCH data is represented in the form of <strong>multidimensional arrays<\/strong>, which in the nomenclature are called \u201c<strong>tensioners<\/strong>\u201d. These matrix structures, the \u201ctensors\u201d, store the inputs, parameters and outputs of the neural network. Using \u201ctensors\u201d you can train the network. Pytorch has the advantage of creating dynamic graphs with the \u201ctensor\u201d data. Also, it allows modifications to be made between connections. When making predictions and estimating error rates, adjusting \u201ctensors\u201d makes predictions more accurate.<\/li><li>PyTorch has features that <strong>considerably speed up calculations<\/strong>. It is a framework that allows us <strong>use any Cloud<\/strong>. <\/li><li>This is very interesting, especially when using <strong>Amazon SageMaker<\/strong>. This AWS service makes it possible for us to train the models in a very simple way. Another advantage of working with <strong>AWS (Amazon Web Services) <\/strong>is that through <strong>TorchScript and TorchServe<\/strong> the path from development to production is accelerated. The TorchServe and Torch Elastic functionalities allow the deployment of already trained neural networks and use PyTorch in Kubernetes. The package <strong>Torchvision<\/strong> It consists of common data sets, model architectures, and image transformations for vision. The list of ecosystems is enormous, this gives an idea of its versatility.<\/li><\/ul>\n\n\n\n<p>In summary, <strong>PyTorch and Python<\/strong> they work in one <strong>very integrated way<\/strong> and it turns out very <strong>easy to make code<\/strong> with PyTorch. Has a <strong>community and a very active ecosystem<\/strong> and its documentation is very well organized. Debugging is easy and creating novel structures is very intuitive.<\/p>\n\n\n\n<p>In our <a href=\"https:\/\/eiposgrados.com\/eng\/programs\/master-in-python\/\">master&#039;s degree in Advanced Programming in Python for Hacking, Big Data and Machine Learning<\/a>, we will study the operation of the Keras and Tensorflow tools, specifically in the subject of \u201c<strong>Python programming for Machine Learning<\/strong>\u201d&nbsp;<\/p>\n\n\n\n<p>Don&#039;t stay with the desire to learn!&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>Get an analysis of the main frameworks that allow you to develop complex models with little code: Pytorch vs Keras vs Tensorflow. Let&#039;s read it!<\/p>","protected":false},"author":90,"featured_media":58030,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[407],"tags":[],"class_list":["post-58027","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-python"],"acf":[],"_links":{"self":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/posts\/58027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/users\/90"}],"replies":[{"embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/comments?post=58027"}],"version-history":[{"count":0,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/posts\/58027\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/media\/58030"}],"wp:attachment":[{"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/media?parent=58027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/categories?post=58027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eiposgrados.com\/eng\/wp-json\/wp\/v2\/tags?post=58027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}