Layers

paddle.v2.layer is a part of model config packages in paddle.v2. In API v2, we want to make Paddle a plain Python package. The model config package defined the way how to configure a neural network topology in Paddle Python code.

The primary usage shows below.

import paddle.v2 as paddle

img = paddle.layer.data(name='img', type=paddle.data_type.dense_vector(784))
hidden = paddle.layer.fc(input=img, size=200)
prediction = paddle.layer.fc(input=hidden, size=10,
                             act=paddle.activation.Softmax())

# use prediction instance where needed.
parameters = paddle.v2.parameters.create(cost)
paddle.v2.layer.parse_network(*outputs)

parse all output layers and then generate a model config proto. :param outputs: :return: