How to do it...

  1. Let's start with loading the libraries:
import numpy as npimport osfrom cntk import Trainer, Axisfrom cntk.io import MinibatchSource, CTFDeserializer, StreamDef, StreamDefs, INFINITELY_REPEATfrom cntk.learners import momentum_sgd, fsadagrad, momentum_as_time_constant_schedule, learning_rate_schedule, UnitTypefrom cntk import input, cross_entropy_with_softmax, classification_error, sequence,                 element_select, alias, hardmax, placeholder, combine, parameter, times, plusfrom cntk.ops.functions import CloneMethod, load_model, Functionfrom cntk.initializer import glorot_uniformfrom cntk.logging import log_number_of_parameters, ProgressPrinterfrom cntk.logging.graph import plotfrom cntk.layers import *from cntk.layers.sequence import ...

Get Python Deep Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.