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

fixed the name issue for conv_operator and added a test case #131

Merged
merged 1 commit into from
Sep 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions python/paddle/trainer_config_helpers/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2704,8 +2704,8 @@ def conv_operator(img, filter, filter_size, num_filters,
PaddlePaddle now supports rectangular filters,
the filter's shape can be (filter_size, filter_size_y).
:type filter_size_y: int
:param num_filter: channel of output data.
:type num_filter: int
:param num_filters: channel of output data.
:type num_filters: int
:param num_channel: channel of input data.
:type num_channel: int
:param stride: The x dimension of the stride.
Expand All @@ -2726,7 +2726,7 @@ def conv_operator(img, filter, filter_size, num_filters,
if padding_y is None:
padding_y = padding
op = ConvOperator(input_layer_names=[img.name, filter.name],
num_filters = num_filter,
num_filters = num_filters,
conv_conf=Conv(filter_size=filter_size,
padding=padding,
stride=stride,
Expand Down
11 changes: 10 additions & 1 deletion python/paddle/trainer_config_helpers/tests/layers_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,23 @@

x1 = fc_layer(input=x, size=5)
y1 = fc_layer(input=y, size=5)

z1 = mixed_layer(act=LinearActivation(),
input=[conv_operator(img=x1,
filter=y1,
filter_size=1,
num_filters=5,
num_channel=5,
stride=1)])

y2 = fc_layer(input=y, size=15)

cos1 = cos_sim(a=x1, b=y1)
cos3 = cos_sim(a=x1, b=y2, size=3)

linear_comb = linear_comb_layer(weights=x1, vectors=y2, size=3)

out = fc_layer(input=[cos1, cos3, linear_comb, z],
out = fc_layer(input=[cos1, cos3, linear_comb, z, z1],
size=num_classes,
act=SoftmaxActivation())

Expand Down