def comma_model():
row, col, depth = 66, 200, 3
shape = (row, col, depth)
model = Sequential()
model.add(Lambda(lambda x: x/127.5 -1., input_shape=shape, output_shape=shape))
model.add(Convolution2D(16, 8, 8, subsample=(4, 4), border_mode='same'))
model.add(ELU())
model.add(Convolution2D(32, 5, 5, subsample=(2, 2), border_mode='same'))
model.add(ELU())
model.add(Convolution2D(64, 5, 5, subsample=(2, 2), border_mode='same'))
model.add(Flatten())
model.add(Dropout(.2))
model.add(ELU())
model.add(Dense(512))
model.add(Dropout(.5))
model.add(ELU())
#the fully connected layer accounts for huge % of parameters (50+)
model.add(Dense(1))
model.compile(loss='mse', optimizer='adam')
model.summary()
return model
评论列表
文章目录