Constraints can be selectively applied on layers using regular expressions. Constraints can be explicit (hard) constraints applied at an arbitrary batch or epoch frequency, or they can be implicit (soft) constraints similar to regularizers where the the constraint deviation is added as a penalty to the total model loss.

class pywick.constraints.Constraint[source]

Default class from which all Constraint implementations inherit.

class pywick.constraints.MaxNorm(value, axis=0, frequency=1, unit='batch', module_filter='*')[source]

MaxNorm weight constraint.

Constrains the weights incident to each hidden unit to have a norm less than or equal to a desired value.

Any hidden unit vector with a norm less than the max norm constaint will not be altered.

class pywick.constraints.NonNeg(frequency=1, unit='batch', module_filter='*')[source]

Constrains the weights to be non-negative.

class pywick.constraints.UnitNorm(frequency=1, unit='batch', module_filter='*')[source]

UnitNorm constraint.

Constraints the weights to have column-wise unit norm