Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add attr() interface to layer #2073

Merged
merged 1 commit into from
May 10, 2017

Conversation

jacquesqiao
Copy link
Member

@jacquesqiao jacquesqiao commented May 9, 2017

fix: #1811

import paddle.v2 as paddle


x = paddle.layer.data(name='x', type=paddle.data_type.dense_vector(13))
y_predict = paddle.layer.fc(input=x,
                            size=1,
                            act=paddle.activation.Linear())
y = paddle.layer.data(name='y', type=paddle.data_type.dense_vector(1))
cost = paddle.layer.mse_cost(input=y_predict, label=y)

print cost.attr()
#print cost.attr().size

will get

name: "__mse_cost_0__"
type: "square_error"
size: 1
active_type: ""
inputs {
  input_layer_name: "__fc_layer_0__"
}
inputs {
  input_layer_name: "y"
}
coeff: 1.0

@jacquesqiao jacquesqiao merged commit b333531 into PaddlePaddle:develop May 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

python fields (num_filters and size) in v2 api ?
2 participants