Deep Learning is a subset of machine learning that uses multi-layered artificial neural networks to learn hierarchical representations of data, enabling computers to automatically discover patterns and features without explicit programming. It powers modern AI applications from computer vision and natural language processing to speech recognition and autonomous systems. The field has evolved from basic feedforward networks to sophisticated architectures like transformers, state space models, and diffusion models, with gradient-based optimization and backpropagation remaining the fundamental learning mechanisms. Understanding the trade-offs between model capacity, computational efficiency, and generalization is critical for practitioners building production systems.
What This Cheat Sheet Covers
This topic spans 21 focused tables and 232 indexed concepts, 211 flashcards, 7 practice tests with 258 questions. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Neural Network Architectures
These are the blueprints: the high-level shapes a network can take, each suited to a different kind of data. Convolutional networks and their descendants (ResNet, VGG, Inception) dominate images, recurrent designs (RNN, LSTM, GRU) handle sequences, and transformers and Vision Transformers have largely taken over both, while GANs, VAEs, and autoencoders specialize in generating and compressing data.
| Architecture | Example | Description | |
|---|---|---|---|
layer = nn.TransformerEncoderLayer( d_model=512, nhead=8)encoder = nn.TransformerEncoder(layer, num_layers=6) | • Attention-based architecture processing sequences in parallel, with no recurrence • dominant in NLP, vision, and multimodal AI, though self-attention cost grows quadratically with sequence length. | ||
model = Sequential([ Conv2D(32, 3, activation='relu'), MaxPooling2D(2), Flatten(), Dense(10)]) | • Grid-structured data processor using convolutional layers for spatial feature extraction • learns a hierarchy of features, edges and colours early, whole objects deeper. | ||
model = Sequential([ LSTM(128, return_sequences=True), Dense(output_dim)]) | • RNN variant with three gates (input, forget, output) guarding an additive cell state • mitigates the vanishing gradient problem for long-term dependencies (it does not eliminate it). | ||
x = Conv2D(64, 3)(x)x = Add()([x, shortcut])x = Activation('relu')(x) | • Deep CNN with skip connections that add a block's input to its output • made 100+ layer networks trainable, reaching 152 layers at lower complexity than VGG. | ||
model = VisionTransformer( image_size=224, patch_size=16, num_classes=1000) | • Applies transformer architecture to image patches treated as tokens • lacks a CNN's built-in locality and translation equivariance, so it needs large-scale pretraining to match one. | ||
generator = Sequential([Dense(256), ...])discriminator = Sequential([Dense(256), ...]) | • Dual-network system with generator creating samples and discriminator distinguishing real from fake • the two losses are adversarial, so a winning discriminator starves the generator of gradient. | ||
encoder = Sequential([Dense(latent_dim*2)])decoder = Sequential([Dense(input_dim)]) | • Probabilistic generative model learning latent distributions you can sample from • enables controlled generation, though image samples tend to be blurrier than a GAN's. | ||
encoder = Sequential([Dense(128), Dense(64)])decoder = Sequential([Dense(128), Dense(input_dim)]) | • Unsupervised network trained to copy its input to its output through a bottleneck • used for dimensionality reduction, denoising, and feature learning. | ||
encoder_output = Conv2D(...)(x)decoder_input = Concatenate()([upsampled, encoder_output]) | • CNN with a contracting encoder-decoder structure plus skip connections • outputs a per-pixel map at input resolution for image segmentation. | ||
model = Sequential([ SimpleRNN(128, return_sequences=True), Dense(vocab_size)]) | • Sequential data processor with hidden state that carries temporal information • cannot parallelize across timesteps, and suffers vanishing gradients on long sequences. | ||
model = Sequential([ GRU(128, return_sequences=True), Dense(output_dim)]) | • Simplified LSTM with two gates (update, reset) and no separate cell state • fewer parameters and faster to compute, with comparable performance. | ||
model = Sequential([ Bidirectional(LSTM(128)), Dense(output_dim)]) | • RNN processing sequences in both forward and backward directions • needs the whole sequence up front, so it cannot be used for streaming or causal generation. | ||
model = Sequential([ Conv2D(96, 11, strides=4), MaxPooling2D(3, 2), Conv2D(256, 5), Flatten(), Dense(4096)]) | • 8-layer GPU-trained CNN that revolutionized ImageNet in 2012 • used ReLU and dropout to show learned features beat hand-designed ones. | ||
model = Sequential([ Conv2D(64, 3), Conv2D(64, 3), MaxPooling2D(), Conv2D(128, 3), Conv2D(128, 3)]) | • Deep CNN using uniform 3×3 convolutions stacked in repeating blocks, 16-19 weight layers • two stacked 3×3 convs match one 5×5's receptive field with fewer parameters. | ||
x = Concatenate()([ Conv2D(64, 1)(x), Conv2D(128, 3)(x), Conv2D(32, 5)(x), MaxPooling2D(3)(x)]) | • Multi-scale CNN with four parallel branches of different kernel sizes • concatenates them so one block extracts features at several scales at once. |