Skip to content
This repository was archived by the owner on Feb 17, 2026. It is now read-only.

CNTK 2.0 Python API

Chris Basoglu edited this page Oct 19, 2016 · 103 revisions

Examples:

The best way to learn about the APIs currently is to look at the following examples in the [CNTK clone root]/bindings/python/examples directory:

  • MNIST: A fully connected feed-forward model for classification of MNIST images. (follow the instructions in Examples/Image/DataSets/MNIST/README.md)

  • CifarRest: An image classification ResNet model for training on the CIFAR image dataset. (follow the instructions in Examples/Image/DataSets/CIFAR-10/README.md to get the CIFAR dataset and convert it to the CNTK supported format)

  • SequenceClassification: An LSTM sequence classification model for text data.

  • Sequence2Sequence: A sequence to sequence grapheme to phoneme translation model that trains on the CMUDict corpus.

  • NumpyInterop – numpy interop example showing how to train a simple feed-forward network with training data fed using numpy arrays.

  • SLUHandson – Language Understanding.

Known issues and limitations:

This is an alpha release meant for early users to try the bits and provide feedback on the usability and functional aspects of the API. These bits have undergone limited testing so far, so expect some rough edges. Also please expect the API to undergo changes over the coming weeks, which may break backwards compatibility of programs written against the alpha release.

  • Only a subset of the planned functionality is available; features like distributed training, automatic LR and MB size search and API extensibility will become available over the next few weeks.

  • Python 2.7 support is currently unavailable but will be part of the upcoming beta release.

  • On Windows only Python 3.4 is supported and not Python 3.5 since the latter requires Visual Studio 2015 which CNTK has not yet migrated to. This will also be addressed before the upcoming beta release.

  • The core API itself is implemented in C++ for speed and efficiency and python bindings are created through SWIG. We are increasingly creating thin python wrappers for the APIs to attach docstrings to, but this is a work in progress and for some of the APIs, you may directly encounter SWIG generated API definitions (which are not the prettiest to read).

  • Shape and dimension inference support is currently unavailable and the shapes of all Variable objects have to be fully specified.

Clone this wiki locally