This commit is contained in:
Frank Seide 2016-08-09 21:33:21 -07:00
Родитель 4cd66b6d79
Коммит 6772d27f4e
1 изменённых файлов: 86 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,86 @@
# Simple CIFAR-10 convnet
command = Train:Eval
makeMode = false ; traceLevel = 1 ; deviceId = 0
RootDir = "." ; DataDir = "$RootDir$" ; ModelDir = "$RootDir$/Output/Models"
modelPath = "$ModelDir$/01_Convolution"
Train = [
action = "train"
BrainScriptNetworkBuilder = [
imageShape = 32:32:3
labelDim = 10
Subtract128 (x) = x - Constant (128)
model = Sequential (
Subtract128 :
ConvolutionalLayer {32, (5:5), activation = ReLU, init = "gaussian", initValueScale = 0.0043} :
MaxPoolingLayer {(3:3), stride = (2:2)} :
ConvolutionalLayer {32, (5:5), activation = ReLU, init = "gaussian", initValueScale = 1.414} :
MaxPoolingLayer {(3:3), stride = (2:2)} :
ConvolutionalLayer {64, (5:5), activation = ReLU, init = "gaussian", initValueScale = 1.414} :
MaxPoolingLayer {(3:3), stride = (2:2)} :
DenseLayer {64, activation = ReLU, init = "gaussian", initValueScale = 12} :
Dropout :
LinearLayer {labelDim, init = "gaussian", initValueScale = 1.5}
)
# inputs
features = Input {imageShape}
labels = Input {labelDim}
# apply model to features
z = model (features)
# connect to system
ce = CrossEntropyWithSoftmax (labels, z)
errs = ErrorPrediction (labels, z)
top5Errs = ErrorPrediction (labels, z, topN=5) # only used in Eval action
featureNodes = (features)
labelNodes = (labels)
criterionNodes = (ce)
evaluationNodes = (errs)
outputNodes = (z)
]
SGD = [
epochSize = 49984
minibatchSize = 64
learningRatesPerMB = 0.01*10:0.003*10:0.001
momentumPerMB = 0.9*20:0.99
maxEpochs = 30
L2RegWeight = 0.03
dropoutRate = 0*5:0.5
firstMBsToShowResult = 10
numMBsToShowResult = 500
]
reader = [
readerType = "CNTKTextFormatReader"
file = "$DataDir$/Train_cntk_text.txt"
input = [
features = [ dim = 3072 ; format = "dense" ]
labels = [ dim = 10 ; format = "dense" ]
]
]
]
Eval = [
action = "eval"
minibatchSize = 16
evalNodeNames = errs:top5Errs # also test top-5 error rate
reader = [
readerType = "CNTKTextFormatReader"
file = "$DataDir$/Test_cntk_text.txt"
input = [
features = [ dim = 3072 ; format = "dense" ]
labels = [ dim = 10 ; format = "dense" ]
]
]
]