Up and Running with MXNet
MXNet is one of the most used deep learning frameworks and is an Apache open source project. Before 2016, Amazon Web Services (AWS)’s research efforts did not use a preferred deep learning framework, allowing each team to research and develop according to their choices. Although some deep learning frameworks have thriving communities, sometimes AWS was not able to fix code bugs at the required speed (among other issues). To solve these issues, at the end of 2016, AWS announced MXNet as its deep learning framework of choice, investing in internal teams to develop it further. Research institutions that support MXNet are Intel, Baidu, Microsoft, Carnegie Mellon University, and MIT, among others. It was co-developed by Carlos Guestrin at Carnegie Mellon University and the University of Washington (along with GraphLab).
Some of its advantages are as follows:
- Imperative/symbolic programming and hybridization (which will be covered in Chapters 1 and 9)
- Support for multiple GPUs and distributed training (which will be covered in Chapters 7 and 8)
- Highly optimized for inference production systems (which will be covered in Chapters 7 and 9)
- A large number of pre-trained models on its Model Zoos in the fields of computer vision and natural language processing, among others (covered in Chapters 6, 7, and 8)
To start working with MXNet, we need to install the library. There are several different versions of MXNet available to be installed, and in this chapter, we will cover how to choose the right version. The most important parameter will be the available hardware we have. In order to optimize performance, it is always best to maximize the use of our available hardware. We will compare the usage of a well-known linear algebra library, NumPy, with similar operations in MXNet. We will then compare the performance of the different MXNet versions versus NumPy.
MXNet includes its own API for deep learning, Gluon, and moreover, Gluon provides different libraries for computer vision and natural language processing that include pre-trained models and utilities. These libraries are known as GluonCV and GluonNLP.
In this chapter, we will cover the following topics:
- Installing MXNet, Gluon, GluonCV, and GluonNLP
- NumPy and MXNet ND arrays – comparing their performance