Comparison of deep learning frameworks: TensorFlow, PyTorch, Keras, MXNet, Microsoft Cognitive Toolkit, Caffe, etc

Original author: Mateusz Opala
  • Transfer
Hello. This Friday, we are sharing with you the first publication on the launch of the Data Scientist course . Have a good reading.

A great many organizations have set about trying to use artificial intelligence in their decisions to expand the scope of activities or develop their start-up, but one important thing to understand: the chosen development technology must go along with a good framework for deep learning, especially because each framework serves to some kind of separate goal. The search for the perfect tandem in this case is a prerequisite for the smooth and rapid development of the business and the successful deployment of projects.



The following list of frameworks for deep learning can be of help in the process of choosing the right tool for solving specific problems that you face in the process of working on a project. You can compare the pros and cons of various solutions, evaluate their limits and learn about the best use cases for each solution!

1. Tensorflow

Created by Google and written in Python and C ++, TensorFlow is one of the best open source libraries for numerical computing. It simply has to be good, because even giants like DeepMind, Uber, AirBnB or Dropbox have chosen this framework for their needs.

TensorFlow is good for complex projects such as multi-layer neural networks. It is used for voice recognition or pictures and text applications such as Google Translate, for example.

Of course, experts called many of its advantages:

  • A large number of manuals and documentation have been written for her;
  • It offers powerful tools for monitoring the learning process of models and visualization (Tensorboard);
  • It is supported by a large community of developers and tech companies;
  • It provides service models;
  • It supports distributed learning;
  • TensorFlow Lite provides output to low latency devices for mobile devices;

And disadvantages:

It loses speed of operation in standard tests , in comparison with CNTK and MXNet, for example;
It has a higher entry threshold for beginners than PyTorch or Keras. Naked Tensorflow is quite low-level and requires a lot of boilerplate code, and the "detect and run" mode for Tensorflow greatly complicates the debugging process.

There is another significant limitation: the only fully supported language is Python.

2. PyTorch

PyTorch is Python's successor to the Lua Torch library, and a great competitor to TensorFlow. It was developed by Facebook and used by Twitter, Salesforce, Oxford University and many other companies.

PyTorch is mainly used to train models quickly and efficiently, so this is the choice of a large number of developers.

It has many important advantages:

  • Thanks to the architecture of the framework, the process of creating a model is quite simple and transparent;
  • The default “define-by-run” mode is a reference to traditional programming. The framework supports popular debugging tools such as pdb, ipdb, or PyCharm debugger;
  • It supports declarative data concurrency ;
  • It has many pre-trained models and prefabricated modular parts that are easy to combine;

Distributed training is available since version 0.4.

But this framework has some undeniable minuses:

  • Lack of model support;
  • He is not yet ready for a full release in production, but the roadmap to version 1.0 looks really impressive;
  • There is a lack of interfaces for monitoring and visualization, like the TensorBoard - however, it does have an external connection to the Tensorboard.


3. Keras

Keras is a minimal Python-based library that can run on top of TensoFlow, Theano, or CNTK. It was developed by a Google engineer, François Schollet, to speed up experiments. Keras supports a wide range of neural network layers, such as convolutional layers, recurrent or dense.

This framework is good in cases for translation, image recognition, speech, etc.

Benefits:

  • Prototyping is really quick and easy;
  • It is small enough to build deep learning models for many layers;
  • Has fully configurable modules;
  • It has a simple and intuitive interface, respectively, good for beginners;
  • Has built-in support for training on multiple GPUs;
  • It can be configured as evaluators for TensorFlow and trained on GPU clusters on the Google Cloud platform;
  • Runs on Spark;
  • Supports NVIDIA GPUs, Google TPUs, Open-CL GPUs such as AMD.

And a few drawbacks:

  • It may turn out to be too high-level and is not always easy to customize;
  • It is limited to Tensorflow, CNTK, and Theano backends.

Keras is not as functional as TensorFlow and provides fewer options for managing a network connection, which can be a serious limitation if you are going to create some specialized deep learning model.

4. MXNet


This is a deep learning framework created by Apache that supports an abundance of languages ​​such as Python, Julia, C ++, R, or JavaScript. It is used by Microsoft, Intel, and Amazon Web Services.

The MXNet framework is known for its high scalability, which is why it is used by large companies mainly for speech recognition and handwriting, NLP and forecasting.
It has many advantages:

  • It is fast enough, flexible and effective in working with deep learning algorithms;
  • It provides advanced GPU support;
  • It can run on any device;
  • It has a high-performance imperative API;
  • It provides easy model support;
  • It is extremely scalable;
  • It provides good support for many programming languages, such as Python, R, Scala, JavaScript and C ++, and many others.

Now for the disadvantages of MXNet:

  • Around him there is no longer such a community as around TensorFlow;
  • Not so popular in the scientific community.

Based on the above arguments, MXNet is a good framework for large industrial projects, but it is still quite young, so remember that you may not receive technical support in resolving your issue as quickly as you would like.

5. CNTK

Now this framework is called Microsoft Cognitive Toolkit. It is an open deep learning framework designed to work with really large datasets with support for Python, C ++, C # and Java.

CNTK provides effective model training for voice, handwriting and picture recognition, and also supports CNN and RNN. It is used on Skype, Xbox and Cortana.

As always, experts have already appreciated its benefits:

  • Shows good performance and scalability;
  • Provides many well-optimized components;
  • Offers support for Apache Spark;
  • Effective in the use of resources;
  • Has easy integration with Azure Cloud;

And one single drawback:

  • Limited community support.

6. Caffe and Caffe2

Caffe is a C ++ framework that has a very usable Python interface. It supports CNN and direct distribution networks, and is also good for training models (without writing extra lines of code), processing images, and improving existing neural networks. On the other hand, it is not so well documented and difficult to compile. There is no information on the use of Caffe by any large companies. In 2017, Facebook released Caffe 2, which became the real successor to Caffe, and was created for both mobile and large-scale development in the production environment.

On Facebook, he is known as,“A production-ready platform (...) running on more than 1 billion smartphones, spanning 8 generations of the iPhone and six generations of Android processor architectures.”

This framework is good for several reasons:

  • It offers pre-trained models for creating demo applications;
  • It is fast, scalable and takes up little space;
  • It works well with other frameworks such as PyTorch, and will eventually be integrated into PyTorch 1.0;
  • It provides optimized work with the server.

And again, the main drawback:

  • Limited community support.

Despite the fact that Caffe2 passes tests well in terms of speed and occupied memory, it is relatively new and quite limited in terms of deploying complex networks that require at least convenient tools for debugging and technical support.

7. Deeplearning4j

If your main programming language is Java, then you should definitely take a closer look at DL4J. It is a commercial open source platform written primarily for Java and Scala that provides good support for various types of neural networks (such as CNN, RNN, RNTN, or LTSM).

This framework will be a good choice as it has great potential in the areas of image recognition, natural language processing, vulnerability search and text analysis.

Pros:

  • Reliable, flexible and efficient;
  • It can process large amounts of data without loss of speed;
  • Works with Apache Hadoop and Spark, on distributed CPU or GPU;
  • Has good documentation;
  • Has a community and enterprise version.

What is surprising, speaking about this framework, experts do not focus on any specific flaws, as suppose on a general debate about the suitability of Java for machine learning in general. Since Java is not used so often in machine learning projects, the framework cannot rely on growing databases of ready-made code to solve specific problems. As a result, the costs of your project can become much higher and solving one problem can significantly slow down the overall progress of the project.

8. Chainer

Another Python deep learning framework supported by giants like Intel, IBM, NVIDIA and AWS. It can easily use multiple GPUs.

Chainer is mainly used for voice recognition, machine translation and key analysis. It supports various network architectures, such as CNN, fast-forward, RNN, and has several important advantages over its competitors:

  • It is much faster than any other Python framework;
  • It is incredibly flexible and intuitive;
  • Existing networks can be modified directly at runtime;

On the other hand:

  • Very difficult in terms of debug;
  • Around him is a relatively small community;

Since other Python-based frameworks are much more popular, you may not get as fast help as with other frameworks such as TensorFlow or PyTorch.

Summing up

Choosing the best framework for a deep learning project can be extremely difficult. You need to consider the following factors:

  • The type of neural networks you will develop;
  • The programming language that you use;
  • The number of tools and additional options that you may need;
  • Project budget;
  • The nature and goals that the project pursues.

I hope that this comparison of frameworks will shed some light on this problem and help you choose the most suitable solution for your project.

Write comments and see you at the open day , which will be held March 19 by Alexander Nikitin .

Also popular now: