Sunday, August 19, 2018

MxNet Gluon Linear regression

MxNet is a very powerful Deep Neural Network (DNN) framework. Gluon is part of MxNet, and offers a higher level API. In their own words:

The Gluon package is a high-level interface for MXNet designed to be easy to use, while keeping most of the flexibility of a low level API. Gluon supports both imperative and symbolic programming, making it easy to train complex models imperatively in Python and then deploy with a symbolic graph in C++ and Scala.

It is very easy to get started with MxNet and Gluon using AWS Sagemaker hosted notebooks. You may be eligible for Sagemaker's free tier (https://aws.amazon.com/sagemaker/pricing/).

I have created a notebook showing:

* How to use Gluon to define a simple DNN to perfrom linear regression
* Train the DNN
* Save the DNN
* Restore the DNN

My notebook is available in github (https://github.com/julitopower/LearnMachineLearning/blob/master/Gluon_linear_regression.ipynb), and can be imported into Sagemaker notebooks (select conda_python3 environment).

Disclaimer: This blog reflects only my personal experiences and opinions, which are not necessarily those of my employer.