Skip to content

Commit ec1435b

Browse files
committed
adding bias add and activation to conv2d
1 parent 6e896d5 commit ec1435b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

python/libs/connections.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def conv2d(x, n_filters,
115115
k_h=5, k_w=5,
116116
stride_h=2, stride_w=2,
117117
stddev=0.02,
118-
activation=lambda x: x,
118+
activation=None,
119119
bias=True,
120120
padding='SAME',
121121
name="Conv2D"):
@@ -159,5 +159,7 @@ def conv2d(x, n_filters,
159159
b = tf.get_variable(
160160
'b', [n_filters],
161161
initializer=tf.truncated_normal_initializer(stddev=stddev))
162-
conv = conv + b
162+
conv = tf.nn.bias_add(conv, b)
163+
if activation:
164+
conv = activation(conv)
163165
return conv

0 commit comments

Comments
 (0)