Package org.deeplearning4j.util
Class CapsuleUtils
- java.lang.Object
-
- org.deeplearning4j.util.CapsuleUtils
-
public class CapsuleUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description CapsuleUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SDVariablesquash(SameDiff SD, SDVariable x, int dim)Compute the squash operation used in CapsNet The formula is (||s||^2 / (1 + ||s||^2)) * (s / ||s||).
-
-
-
Method Detail
-
squash
public static SDVariable squash(SameDiff SD, SDVariable x, int dim)
Compute the squash operation used in CapsNet The formula is (||s||^2 / (1 + ||s||^2)) * (s / ||s||). Canceling one ||s|| gives ||s||*s/((1 + ||s||^2)- Parameters:
SD- The SameDiff environmentx- The variable to squash- Returns:
- squash(x)
-
-