This project is read-only.

CNTK has moved to GitHub

Please go to GitHub repository and CNTK Web Site for the current documentation



User Manual

The detailed introduction of the computational network and its implementation as well as the user manual of the computational network toolkit (CNTK) can be found at

Amit Agarwal, Eldar Akchurin, Chris Basoglu, Guoguo Chen, Scott Cyphers, Jasha Droppo, Adam Eversole, Brian Guenter, Mark Hillebrand, Ryan Hoens, Xuedong Huang, Zhiheng Huang, Vladimir Ivanov, Alexey Kamenev, Philipp Kranen, Oleksii Kuchaiev, Wolfgang Manousek, Avner May, Bhaskar Mitra, Olivier Nano, Gaizka Navarro, Alexey Orlov, Marko Padmilac, Hari Parthasarathi, Baolin Peng, Alexey Reznichenko, Frank Seide, Michael L. Seltzer, Malcolm Slaney, Andreas Stolcke, Huaming Wang, Yongqiang Wang, Kaisheng Yao, Dong Yu, Yu Zhang, Geoffrey Zweig (in alphabetical order), "An Introduction to Computational Networks and the Computational Network Toolkit", Microsoft Technical Report MSR-TR-2014-112, 2014.

You can also read the somewhat outdated slide deck used in the ICASSP 2015 tutorial session.

Note: For builds before May 18, 2015 the executable is called cn which is now changed to cntk.

There are also four files in the documentation directory of the source that contain additional details.

Clone Source Code (Windows)

The CNTK project uses Git as the source version control system.

If you have Visual Studio 2013 installed Git is already available. You can follow the "Clone a remote Git repository from a third-party service" section in Set up Git on your dev machine (configure, create, clone, add) and connect to to clone the source code. We found that installing Git Extension for VS is still helpful esp. for new users.

Otherwise you can install Git for your OS from the Using Git with CodePlex page and clone the CNTK source code with the command "git clone".

See Windows Visual Studio Setup below for more installation steps.

Clone Source Code (Linux/mac)

For the linux user please replace "git01" to "git" (otherwise you will get an RPC error):

git clone 

See Linux Setup below for more installation steps.

Windows Visual Studio Setup (CNTK only runs on 64-bit OS)

Linux Setup

  • Get the ACML Math library from  Choose the acml-5-3-1-ifort-64bit.tgz option. Untar: tar -xzvf ./acml-5-3-1-ifort-64bit.  Install:   sudo ./install-acml-5-3-1-ifort-64bit
  • Set the environment variable ACML_FMA=0
  • Install the GPU deployment kit from NVIDIA by going to  Download the .run file, make it executable and run it.
  • Download and install the latest video driver for your CUDA-enabled GPU:
  • Install cuDNN to enable fast convolutional networks (this is optional):
    • Download Linux version of cuDNN v4 from NVIDIA website:
    • Unpack the archive to a folder. We recommend using the following folder by default: /usr/local/cudnn-4.0
      • Make sure the folder structure is preserved when unpacking the archive.
    • Run ./configure script in CNTK source directory. Verify that cuDNN path was set correctly by the script by looking at Config.make file which should have CUDNN_PATH set to a proper directory.
      • The script will look for /usr/local/cudnn-4.0 by default. If you installed cuDNN to a different directory then run the script with --with-cudnn option:
        ./configure --with-cudnn=<path_to_cudnn4>
  • Permanently (like in .bashrc) do: export PATH=/usr/local/cuda-7.0/bin:$PATH
    and: export LD_LIBRARY_PATH=/usr/local/cuda-7.0/lib64:/opt/acml5.3.1/ifort64_mp/lib:/usr/local/cudnn-4.0:$LD_LIBRARY_PATH
  • Build CUDA tools: cd ~/NVIDIA_CUDA-7.0_Samples/
    and: make
  • cd into the cntk directory created by your git clone command.
  • Configure your cntk build with ./configure
    • If using cuDNN, verify that cuDNN path was set correctly by the script by looking at Config.make file which should have CUDNN_PATH set to a proper directory.
      • The script will look for /usr/local/cudnn-4.0 by default. If you installed cuDNN to a different directory then run the script with --with-cudnn option:
        ./configure --with-cudnn=<path_to_cudnn4>
  • Build with the make command
  • You can build and run simple demo with the Script/build-and-test command.

Coding Standard

  • No TABs. Each TAB should be replaced with 4 spaces in the source code. If you use Visual Studio as your editor, goto Tools|Options|Text Editor|C/C++|Tabs and make sure it is set to Smart Indenting Tab and Indent Size set to 4, and "Insert Spaces" option selected.
  • Follow the same naming conventions as shown in the ComputationNetwork.h file.
  • Open/close braces should be on lines by themselves aligned with previous code indent level, e.g.,

           if (true)

If you are using Visual Studio 2013 as your main development environment, you can load the CppCntk.vssettings file (in the CNTK home directory) which contains settings for C++ editor with defaults like using spaces for tabs, curly brace positioning and other preferences that meet CNTK style guidelines. Note that this file will not change any other settings, like your windows layout etc but it's still a good idea to backup your current settings just in case.

To import/export the settings, use Tools -> Import and Export Settings... Visual Studio menu option.

Once the settings are loaded, you can use Edit -> Advanced -> Format Document (or Ctrl+E,D shortcut) or, which is recommended, Edit -> Advanced -> Format Selection (or Ctrl+E,F shortcut) to format only selected fragment.


Last edited Jan 25, 2016 at 6:19 PM by alexeyo, version 56