Share on social networks!

Pytorch vs Keras vs Tensorflow

Python is one of the most used languages. It has abundant libraries and frameworks, specific for Data Science. 

We are going to carry out a brief analysis of the main frameworks: Pytorch, Keras and Tensorflow. These “frameworks” allow complex models to be developed with little code.


Keras was developed in 2015 by a Google researcher. This framework is very popular and is inspiredor, to a large extent, scikit-learn. Keras, what is very easy to use, but it lacked some functionality for advanced models. For that reason, months after Keras, Google published TensorFlow.

Python Framework Pytorch (1)


It quickly became a reference framework for Deep Learning. It allows us to use Keras, which gives it a certain advantage over other environments. Tensorflow has functionalities deep learning, specially for complex neural networks

However, Tensorflow, although it gave access to those functions, was very complicated for beginners. The updates to these “frameworks” have approximated their modes of operation; Tensorflow uses many of the Keras API, That is, both work together.

Python Keras Framework (1)


PyTorch is a “framework” of Open Source. It allows us to accelerate the developments of “Machine Learning”. PyTorch developed in 2016 by Facebook in “open source”. In 2018 merged with Caffe2 (another Python framework) and improved performance a lot; especially in speed of execution.

PyTorch solves Keras and Tensorflow problems- 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 speed and flexibility so I'm going to analyze some of those advantages. 


  • In PYTORCH data is represented in the form of multidimensional arrays, which in the nomenclature are called “tensioners”. These matrix structures, the “tensors”, store the inputs, parameters and outputs of the neural network. Using “tensors” you can train the network. Pytorch has the advantage of creating dynamic graphs with the “tensor” data. Also, it allows modifications to be made between connections. When making predictions and estimating error rates, adjusting “tensors” makes predictions more accurate.
  • PyTorch has features that considerably speed up calculations. It is a framework that allows us use any Cloud.
  • This is very interesting, especially when using Amazon SageMaker. This AWS service makes it possible for us to train the models in a very simple way. Another advantage of working with AWS (Amazon Web Services) is that through TorchScript and TorchServe 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 Torchvision 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.

In summary, PyTorch and Python they work in one very integrated way and it turns out very easy to make code with PyTorch. Has a community and a very active ecosystem and its documentation is very well organized. Debugging is easy and creating novel structures is very intuitive.

In our master's degree in Advanced Programming in Python for Hacking, Big Data and Machine Learning, we will study the operation of the Keras and Tensorflow tools, specifically in the subject of “Python programming for Machine Learning” 

Don't stay with the desire to learn! 

Subscribe to our newsletter to stay up to date with all the news

EIP International Business School informs you that the data in this form will be processed by Mainjobs Internacional Educativa y Tecnológica, SA as the person responsible for this website. The purpose of collecting and processing personal data is to respond to the query made as well as to send information about the services of the data controller. Legitimation is the consent of the interested party.
You can exercise your rights of access, rectification, limitation and deletion of data in compliance@grupomainjobs.com as well as the right to file a claim with the supervisory authority. You can consult additional and detailed information on Data Protection in the Privacy Policy that you will find in our Web page

Leave a comment