Skip to content

Commit 966f320

Browse files
committed
[layers] update conv1dlayer
1 parent 06988d3 commit 966f320

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tensorlayer/layers.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ class Conv1dLayer(Layer):
11131113
act : activation function, None for identity.
11141114
shape : list of shape
11151115
shape of the filters, [filter_length, in_channels, out_channels].
1116-
strides : an int.
1116+
stride : an int.
11171117
The number of entries by which the filter is moved right at each step.
11181118
padding : a string from: "SAME", "VALID".
11191119
The type of padding algorithm to use.
@@ -1134,8 +1134,8 @@ def __init__(
11341134
self,
11351135
layer = None,
11361136
act = tf.identity,
1137-
shape = [5, 5, 1],
1138-
strides= 1,
1137+
shape = [5, 1, 5],
1138+
stride = 1,
11391139
padding='SAME',
11401140
use_cudnn_on_gpu=None,
11411141
data_format=None,
@@ -1147,18 +1147,18 @@ def __init__(
11471147
):
11481148
Layer.__init__(self, name=name)
11491149
self.inputs = layer.outputs
1150-
print(" [TL] Conv1dLayer %s: shape:%s strides:%s pad:%s act:%s" %
1151-
(self.name, str(shape), str(strides), padding, act.__name__))
1150+
print(" [TL] Conv1dLayer %s: shape:%s stride:%s pad:%s act:%s" %
1151+
(self.name, str(shape), str(stride), padding, act.__name__))
11521152
if act is None:
11531153
act = tf.identity
11541154
with tf.variable_scope(name) as vs:
11551155
W = tf.get_variable(name='W_conv1d', shape=shape, initializer=W_init, **W_init_args )
11561156
if b_init:
11571157
b = tf.get_variable(name='b_conv1d', shape=(shape[-1]), initializer=b_init, **b_init_args )
1158-
self.outputs = act( tf.nn.conv1d(self.inputs, W, stride=strides, padding=padding,
1158+
self.outputs = act( tf.nn.conv1d(self.inputs, W, stride=stride, padding=padding,
11591159
use_cudnn_on_gpu=use_cudnn_on_gpu, data_format=data_format) + b ) #1.2
11601160
else:
1161-
self.outputs = act( tf.nn.conv1d(self.inputs, W, strides=strides, padding=padding,
1161+
self.outputs = act( tf.nn.conv1d(self.inputs, W, stride=stride, padding=padding,
11621162
use_cudnn_on_gpu=use_cudnn_on_gpu, data_format=data_format))
11631163

11641164
self.all_layers = list(layer.all_layers)

0 commit comments

Comments
 (0)