capsnet-tensorflow icon indicating copy to clipboard operation
capsnet-tensorflow copied to clipboard

Squashing function

Open Ugenteraan opened this issue 7 years ago • 0 comments

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

Ugenteraan avatar Jun 26 '18 11:06 Ugenteraan