Line 17 in capsnet.py, shouldn't it be :
scalar_factor = vector_squared_norm / ((1 + vector_squared_norm) / tf.sqrt(vector_squared_norm + epsilon))
instead of
scalar_factor = vector_squared_norm / ((1 + vector_squared_norm) * tf.sqrt(vector_squared_norm + epsilon))
NOTE : changes from multiplication to division.
Because, from the paper, we have
(vector_squared_norm/1+vector_squared_norm) * (vector/sqrt(vector_squared_norm))
which means
((vector_squared_norm/1+vector_squared_norm)/vector_squared_norm)*vector
Line 17 in capsnet.py, shouldn't it be :
scalar_factor = vector_squared_norm / ((1 + vector_squared_norm) / tf.sqrt(vector_squared_norm + epsilon))instead of
scalar_factor = vector_squared_norm / ((1 + vector_squared_norm) * tf.sqrt(vector_squared_norm + epsilon))NOTE : changes from multiplication to division.
Because, from the paper, we have
which means