

def train_model(dataset):
    X = T.tensor4()
    Y = T.lvector()
    layers = []
    layers.append(ConvPoolLayer(input=model, input_shape=(1, 28, 28), filter_shape=(32, 1, 5, 5), pool_shape=(2, 2), active_func=actfuncs.tanh))
    layers.append(ConvPoolLayer(input=layers[(- 1)].output, input_shape=layers[(- 1)].output_shape, filter_shape=(64, 32, 5, 5), pool_shape=(2, 2), active_func=actfuncs.tanh, flatten=True))
    layers.append(FullConnLayer(input=layers[(- 1)].output, input_shape=layers[(- 1)].output_shape, output_shape=512, active_func=actfuncs.tanh))
    layers.append(FullConnLayer(input=layers[(- 1)].output, input_shape=layers[(- 1)].output_shape, output_shape=10, active_func=actfuncs.softmax))
    model = NeuralNet(layers, X, layers[(- 1)].output)
    model.target = Y
    model.cost = costfuncs.neglog(layers[(- 1)].output, Y)
    model.error = costfuncs.miscls_rate(layers[(- 1)].output, Y)
    sgd.train(model, dataset, lr=0.1, momentum=0.9, batch_size=500, n_epochs=200, lr_decr=1.0)
    return model

dataset/ETHPy150Open Cysu/dlearn/examples/mnist_lenet5.py train_model/VarMisuse@39/45 `X`->`model`