Why PyTorch?

When starting with Deep Learning on your own (without any legacy code or compatibility constraint), it may be daunting to choose one among the many frameworks available.

The corresponding Wikipedia page compares 17 of them1, and still manages to omit a few (Caffe2 is sufficiently different from Caffe to be distinguished per se, Apple’s Core ML is missing too for example).

I was searching for a framework that was sufficiently high-level in order to have many building blocks available. I also wanted to have easy and fast feedback loops, so ruled out compiled frameworks such as Dlib (implemented in C++).

There was still quite a bunch of frameworks left, most of them implemented in Python. This is not surprising given the place that Python has taken in Data Science thanks to high quality modules and interactive shells such as iPython/Jupyter.

After watching some basic examples online, I set my choice on one of the latest framework that is also getting a lot of momentum: PyTorch. Being one of the latest, it comes with a nice set of features (autodifferentiation, dynamic computational graph, ONNX support…). It’s also easy to install, and plays nicely with the whole Python ecosystem.

But most importantly, since PyTorch embraces the imperative programming style, as a programmer I felt just at home. I could type commands in an iPython terminal to inspect objects, add printing commands… This is an invaluable complement to the documentation.

Ok, the stage is now set: let’s implement U-net’s with PyTorch. Time to start coding!

  1. Accessed on 11.03.2018. ^