A First Look at the CNTK v2.0 Release Candidate Machine Learning Library

Microsoft CNTK (Microsoft Cognitive Toolkit) is a powerful code library that can be used for many machine learning tasks. A few days ago, CNTK v2.0 Release Candidate 1 became available.

Version 2 is a huge change from version 1 — the versions are so different from a developer’s perspective, that I consider CNTK v2 to be an entirely different library. CNTK v2 is written in C++ but has a Python API interface because nobody wants to torture themselves by writing C++ code unless necessary.

So, I rolled up my developer’s sleeves and dove in. Because I had an old CNTK v2 Beta, I first removed it by 1.) Using the Control Panel to uninstall the Anaconda Python distribution, 2.) Deleting all references to CNTK and repos from my System Environment Variables, and 3.) Deleting the old install directory (C:\local).

With a clean system, I first installed the required Anaconda version 4.1.1 64-bit with Python 3. After verifying Python 3.5 was installed, I used pip to install CNTK by opening a command shell and typing (the URL is really long so I put a space after each slash for readability):

pip install https://cntk.ai/ PythonWheel/ CPU-Only/ 

And the installation just worked. Nice! I verified CNTK was alive by typing:

python -c "import cntk; print(cntk.__version__)"

and CNTK responded by displaying his 2.0rc1 version.

Next I took a CNTK script that I’d written for CNTK v2 Beta and tried to run it. I immediately got lots errors but they weren’t too hard to fix — mostly package name changes.

My script creates a simple, single-hidden-layer neural network and creates a model that can make predictions of the famous Iris Dataset.

CNTK is a very powerful library and has a double, steep learning curve. Because it works at a relatively low level, you must have a good grasp of things like neural network architecture and concepts such as back-propagation. And you must have intermediate or better Python skill. And then learning the library itself is quite difficult.

But the payoff is a very powerful, very fast machine learning library.

This entry was posted in CNTK, Machine Learning. Bookmark the permalink.