public class CapsuleUtils extends Object
CapsuleLayer,
PrimaryCapsules,
CapsuleStrengthLayer| Constructor and Description |
|---|
CapsuleUtils() |
| Modifier and Type | Method and Description |
|---|---|
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||).
|
public static SDVariable squash(SameDiff SD, SDVariable x, int dim)
SD - The SameDiff environmentx - The variable to squashCopyright © 2020. All rights reserved.