simple_mnist_network.py 439 字节
Newer Older
Y
Yu Yang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
from paddle.trainer_config_helpers import *

settings(learning_rate=1e-4, learning_method=AdamOptimizer(), batch_size=1000)

imgs = data_layer(name='pixel', size=784)

hidden1 = fc_layer(input=imgs, size=200)
hidden2 = fc_layer(input=hidden1, size=200)

inference = fc_layer(input=hidden2, size=10, act=SoftmaxActivation())

cost = classification_cost(
    input=inference, label=data_layer(
        name='label', size=10))

outputs(cost)