Loading…
Glossary term
A network trained to compress data into a compact form and then reconstruct it.
An autoencoder has two parts. The encoder squeezes the input into a small code, and the decoder tries to rebuild the original from that code. Training makes the reconstruction as close as possible.
Because the code is small, the network must keep only the most important information.
A tiny autoencoder
import torch.nn as nn
encoder = nn.Sequential(nn.Linear(784, 32), nn.ReLU())
decoder = nn.Sequential(nn.Linear(32, 784), nn.Sigmoid())
# loss = how different decoder(encoder(x)) is from xAutoencoders are used for compression, denoising and anomaly detection, and they inspired generative models.