Skip to content

Commit

Permalink
Integrate zhouwang/hiddenlayername into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Project Philly committed Sep 23, 2016
2 parents 689b473 + a6462c3 commit 667c9e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Examples/Evaluation/CSEvalClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ private static void EvaluateModelMultipleLayers()
using (var model = new IEvaluateModelManagedF())
{
// Desired output layers
const string hiddenLayerName = "h1.z";
const string outputLayerName = "ol.z";
const string hiddenLayerName = "out.h1";
const string outputLayerName = "out.z";

// Load model
string modelFilePath = Path.Combine(Environment.CurrentDirectory, @"..\Output\Models\01_OneHidden");
Expand Down
29 changes: 15 additions & 14 deletions Examples/Image/MNIST/Config/01_OneHidden.cntk
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,37 @@ stderr = "$outputDir$/01_OneHidden_bs_out"
# TRAINING CONFIG
trainNetwork = {
action = "train"

BrainScriptNetworkBuilder = {
imageShape = 28:28:1 # image dimensions, 1 channel only
labelDim = 10 # number of distinct labels
featScale = 1/256
Scale{f} = x => Constant(f) .* x

model = Sequential (
Scale {featScale} :
DenseLayer {200, activation=Sigmoid} :
LinearLayer {labelDim}
)

featScale = 1/256

# This model returns multiple nodes as a record, which
# can be accessed using .x syntax.
model(x) = {
s1 = x * featScale
h1 = DenseLayer {200, activation=Sigmoid} (s1)
z = LinearLayer {labelDim} (h1)
}

# inputs
features = Input {imageShape}
labels = Input (labelDim)

# apply model to features
ol = model (features)
out = model (features)

# loss and error computation
ce = CrossEntropyWithSoftmax (labels, ol)
errs = ClassificationError (labels, ol)
ce = CrossEntropyWithSoftmax (labels, out.z)
errs = ClassificationError (labels, out.z)

# declare special nodes
featureNodes = (features)
labelNodes = (labels)
criterionNodes = (ce)
evaluationNodes = (errs)
outputNodes = (ol)
outputNodes = (out.z)
}

SGD = {
Expand Down

0 comments on commit 667c9e5

Please sign in to comment.