Skip to content

Commit

Permalink
partially replaced tf by keras
Browse files Browse the repository at this point in the history
maxjcohen committed Jan 20, 2018
1 parent cdddfcb commit 5460d7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion capsulelayers.py
Original file line number Diff line number Diff line change
@@ -153,7 +153,8 @@ def body(i, b, outputs):

# The prior for coupling coefficient, initialized as zeros.
# b.shape = [None, self.num_capsule, self.input_num_capsule].
b = tf.zeros(shape=[K.shape(inputs_hat)[0], self.num_capsule, self.input_num_capsule])
# b = tf.zeros(shape=[K.shape(inputs_hat)[0], self.num_capsule, self.input_num_capsule])
b = K.stop_gradient(K.sum(K.zeros_like(inputs_hat), -1))

assert self.routings > 0, 'The routings should be > 0.'
for i in range(self.routings):

0 comments on commit 5460d7d

Please sign in to comment.