nupic.tensorflow.constraints

class SparseWeights(percent_on=0.5, name=None)[source]

Bases: tensorflow.python.keras.constraints.Constraint

Sparse weights constraint.

Constrains the weights to a fixed sparsity rate where a fixed number of weights are always zeros.

Parameters

percent_on – Percentage of weights that are allowed to be non-zero. Default 0.5

get_config()[source]