Constraints

Linear Weight Constraints

These should be used for linear accumulators.

class libspn_keras.constraints.GreaterEqualEpsilonNormalized(epsilon=1e-10, axis=- 2)

Constraints the weight to be greater than or equal to epsilon and then normalizes.

Parameters

epsilon (float) – Constant, usually small non-zero

class libspn_keras.constraints.GreaterEqualEpsilon(epsilon=1e-10)

Constraints the weight to be greater than or equal to epsilon.

Parameters

epsilon (float) – Constant, usually small non-zero

Log Weight Constraints

These should be used for log accumulators.

class libspn_keras.constraints.LogNormalized(axis=- 2)

Normalizes log-space weights.

Parameters

axis (int) – Axis along whichto normalize

Scale Constraints

The following constraint is useful for ensuring stable scale parameters in location-scale leaf layers.

class libspn_keras.constraints.Clip(min, max=None)

Constraints the weights to be between min and max.

Parameters
  • min (float) – Minimum clip value

  • max (Optional[float]) – Maximum clip value