Measuring regression model performance in CNTK

Now that we've seen how to validate regression models in theory, let's take a look at how to use the different metrics we just discussed in combination with CNTK. For this section, we'll be working with a model that predicts miles per gallon for cars using the following code:

from cntk import default_options, input_variablefrom cntk.layers import Dense, Sequentialfrom cntk.ops import reluwith default_options(activation=relu):    model = Sequential([        Dense(64),        Dense(64),        Dense(1,activation=None)    ])    features = input_variable(X.shape[1])target = input_variable(1)z = model(features)

Follow the given steps:

  1. First, import the required components from the cntk package
  2. Next, define a default activation ...

Get Deep Learning with Microsoft Cognitive Toolkit Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.