SandHouse
Pages and contents

Sparse Autoencoders

Adapted from Sparse autoencoder lecture notes (Andrew Ng)

Problem

Supervised labelling of data is difficult to scale and generalize. Autoencoders allow us to implement unsupervised learning. The sparse autoencoder enforces a constraint that most of the neurons in a layer are inactive.

Autoencoders

Autoencoders try to learn the identity function hW,b(x)≈x . By placing constraints on the network, you can extract interesting information about the data by trying to “learn” the identity map. For example if you have 100 pixel inputs but only 50 hidden units, the network must learn an optimal compressed form of the data. This algorithm often produces similar outputs to principal component analysis (PCA), but with the power to learn non-linearities.

Sparsity

The sparsity constraint enforced by SAEs is defined by the average activation of a hidden unit j , averaged over the training set.

ρ^j=1m∑imajx(i)

We want to enforce ρ^j=ρ where ρ is the sparsity parameter, a value close to zero such as ρ=0.05 . This means that most hidden activation units will be zero most of the time, enforcing the autoencoder to learn sparse representations of data, increasing the number of distinct concepts that it can learn per hidden size. SAEs also penalize ρ^j from deviating too much from ρ . The penalty term choice is somewhat arbitrary, but an example is

∑j=1sρlog⁡ρρ^j+(1−ρ)log⁡1−ρ1−ρ^j

where s is the number of neurons in the hidden layer. This penalty term is based on KL divergence (a measurement of how different two distributions are) and can be written as ∑j=1sKL(ρ||ρ^j) .

Shortcomings

The SAE is not by itself competitive with the leading supervised feature extraction architectures.