Translate sparsity regularization to Keras regularizer

# S3 method for ruta_sparsity
to_keras(x, activation)

Arguments

x

Sparsity object

activation

Name of the activation function used in the encoding layer

Value

Function which can be used as activity regularizer in a Keras layer

References

Andrew Ng, Sparse Autoencoder. CS294A Lecture Notes (2011)