--- layout: page title: Features subtitle: Whether you are looking for a flexible library to quickly develop cutting-edge deep learning research or a robust framework to push production workload, MXNet caters to all needs. permalink: /features/ action: Get Started action_url: /get_started ---

Hybrid Front-End

The Gluon Python API lets you use MXNet in a fully imperative manner. It also allows you to simply switch to symbolic mode by calling the hybridize functionality. The symbolic execution provides faster and more optimized execution as well as the ability to export the network for inference in different language bindings like java or C++.

{% highlight python %} net = model_zoo.vision.resnet50_v2(pretrained=True) net.hybridize() dummy_input = mx.nd.ones(shape=(1,3,224,224)) net(dummy_input) net.export("symbolic_resnet50") {% endhighlight %}


Distributed Training

{% highlight python %} import horovod.mxnet as hvd # Horovod: initialize Horovod hvd.init() # Horovod: pin a GPU to be used to local rank context = mx.gpu(hvd.local_rank()) {% endhighlight %}

MXNet allows you to make the most out of your hardware, whether it is multi-gpu or multi-host training with near-linear scaling efficiency. MXNet recently introduced support for Horovod, the distributed learning framework developed by Uber.



8 Language Bindings

Deep integration into Python and support for Scala, Julia, Clojure, Java, C++, R and Perl. Combined with the hybridization feature, this allows a very smooth transition from Python training to deployment in the language of your choice to shorten the time to production.

{% highlight java %} import org.apache.mxnet.javaapi.*; ... List inputDesc = new ArrayList<>(); Shape inputShape = new Shape(new int[]{1, 3, 224, 224}); inputDesc.add(new DataDesc("data", inputShape, DType.Float32(), "NCHW")); Predictor predictor = new Predictor(inst.modelPathPrefix, inputDesc, context,0); ... float[][] result = predictor.predict(new float[][]{img.toArray()}); {% endhighlight %}