Autoencoders
g ϕ g\phi g ϕ : encoding function.
f ϕ f\phi f ϕ : decoding function.
ϕ \phi ϕ : parameters of encoding function (trainable).
θ \theta θ : parameters of decoding function (trainable).
MSE Loss:
L A E = 1 2 ∥ x − x ′ ∥ 2 , x ′ = f θ ( g ϕ ( x ) ) L_{AE} = \frac{1}{2}\left\| \mathbf{x -}\mathbf{x}^{\mathbf{'}} \right\|^{2},\mathbf{x}^{\mathbf{'}} = f_{\theta}\left( g_{\phi}(x) \right) L A E = 2 1 x − x ′ 2 , x ′ = f θ ( g ϕ ( x ) )
The autoencoder is trained by gradient descent.
Semi-Supervised Autoencoder
Paper: "Supervised Autoencoders: Improving Generalization Performance with Unsupervised Regularizers" .
The supervised AE uses the latent space to define a second decoding pathway. This path is added as another term to the loss and one calculates the gradients from two different ends. In the shared part, these gradients then merge. This is called multi-task learning (having a shared pathway for different objectives).
L S A E = 1 t ∑ i = 1 t [ L P ( x i , W 1 : 2 , y i ) + L v ( x i , W 1 : 4 , x ^ i ) ] L_{SAE} = \frac{1}{t}\sum_{i = 1}^{t}\left\lbrack L_{P}\left( \mathbf{x}_{\mathbf{i}},\mathbf{W}_{\mathbf{1:2}},\mathbf{y}_{\mathbf{i}} \right) + L_{v}\left( \mathbf{x}_{\mathbf{i}},\mathbf{W}_{\mathbf{1:4}},{\widehat{\mathbf{x}}}_{\mathbf{i}} \right) \right\rbrack L S A E = t 1 i = 1 ∑ t [ L P ( x i , W 1 : 2 , y i ) + L v ( x i , W 1 : 4 , x i ) ]
where:
L P L_{P} L P is the loss of label y i y_{i} y i
L v L_{v} L v is the loss of reconstruction x ^ i {\widehat{x}}_{i} x i
W 1 : 2 \mathbf{W}_{\mathbf{1:2}} W 1 : 2 are the weights of encoder (that produce label y )
W 1 : 4 \mathbf{W}_{\mathbf{1:4}} W 1 : 4 are the weights of encoder + decoder.