api: YAML JSON TOON Database version: 1.0.0 format: json dataset: id: 29 slug: ml-model-architectures title: Machine Learning Model Architectures description: "Overview of major ML model families: feedforward neural networks, CNNs, RNNs/LSTMs, Transformers, GANs, and when to use each." summary: "Machine-learning model architectures with type, structure, layers, uses, pros, cons and notes: feedforward networks, CNNs, RNNs, LSTMs, transformers, GANs and autoencoders, with a selection guide by data type." use_when[2]: "You are choosing an architecture for a data type such as images, text or time series.",You need the strengths and weaknesses of each. caveats[2]: "Guidance is general; strong results often come from architecture, data and training choices together.","Architectures are combined in practice (convolutional layers feeding transformers, for example)." related[4]: neural-network-types,attention-mechanisms,ml-training-algorithms,transfer-learning category: AI & ML Terms category_slug: ai-ml-terms tags: "machine-learning,neural-networks,architectures,cnn,rnn,transformer,gan" view_count: 0 created_at: 1777673262 updated_at: 1777673262 entry_count: 7 fields[14]{section,field,type,example}: architectures,name,string,Feedforward Neural Network (FNN) architectures,type,string,Dense / MLP architectures,structure,string,Input → Hidden layers (dense) → Output. No cycl… architectures,layers,array,"[3 items]" architectures,use_cases,array,"[3 items]" architectures,pros,array,"[3 items]" architectures,cons,array,"[2 items]" architectures,notes,string,Also called Multi-Layer Perceptron (MLP); found… architectures,key_layers,object,"{convolution,pooling,fully_connected}" architectures,variants,array|object,"[3 items]" architectures,gates,object,"{forget_gate,input_gate,output_gate}" architectures,core_mechanism,string,"Self-attention: each token attends to all other…" architectures,training,string,"Alternating: train D on real/fake, then train G…" selection_guide,*,object,"{tabular_data,images,sequences_short,sequences_long}" data: architectures[7]: - name: Feedforward Neural Network (FNN) type: Dense / MLP structure: Input → Hidden layers (dense) → Output. No cycles or feedback connections. layers[3]: Input layer,One or more hidden layers (ReLU/common),Output layer (linear/softmax/sigmoid) use_cases[3]: Tabular data classification/regression,Simple pattern recognition,Baseline model pros[3]: Simple to implement,Universal approximator (with enough width/depth),Fast inference cons[2]: Ignores spatial/temporal structure,Parameter count grows quickly with input size notes: Also called Multi-Layer Perceptron (MLP); foundation for all deep nets - name: Convolutional Neural Network (CNN) type: Spatial hierarchy structure: "Convolutional layers (filters) → pooling → fully connected. Local receptive fields, weight sharing." key_layers: convolution: "Applies filters/kernels to detect local patterns (edges, textures)" pooling: Downsampling (max/avg) for translation invariance fully_connected: Final classification/regression layers use_cases[4]: Image classification,Object detection,Medical imaging,Time series (1D conv) pros[3]: Parameter sharing (efficient),Spatial invariance,Detects hierarchical features cons[2]: Fixed receptive field (unless dilated),Not inherently good for sequential data notes: "Architecture depth (ResNet, Inception) matters more than width for vision" - name: Recurrent Neural Network (RNN) type: Sequential / temporal structure: Recurrent connections; hidden state carries information across time steps. variants[3]: Vanilla RNN (simple recurrence),LSTM (Long Short-Term Memory),GRU (Gated Recurrent Unit) use_cases[4]: Language modeling,Time series prediction,Speech recognition,Sequence tagging pros[2]: Handles variable-length sequences,Theoretically infinite memory (with LSTM/GRU) cons[3]: Sequential processing (hard to parallelize),Vanishing/exploding gradients (vanilla RNN),LSTM/GRU complex notes: LSTM/GRU gates mitigate vanishing gradients; still largely superseded by Transformers for NLP - name: Long Short-Term Memory (LSTM) type: Recurrent with gates structure: Cell state + forget/input/output gates. Controls information flow over long sequences. gates: forget_gate: Decide what to discard from cell state input_gate: Decide what new information to store output_gate: Decide what to output based on cell state use_cases[3]: Machine translation (legacy),Speech synthesis,Text generation (pre-Transformer) pros[2]: Can learn long-range dependencies (~100s steps),Robust to vanishing gradients cons[3]: Still sequential (slow training),Many parameters (4× vanilla RNN),Requires more data than simpler models notes: LSTM superior to vanilla RNN but slower; Transformer now standard for sequence - name: Transformer type: Attention-based structure: Encoder-decoder or encoder-only/decoder-only. Self-attention + feed-forward. Positional encoding. core_mechanism: "Self-attention: each token attends to all others; O(n²) complexity" variants: encoder_only: "BERT (masked attention, pre-training)" decoder_only: "GPT (causal attention, autoregressive)" "encoder-decoder": "T5, original Transformer (translation)" use_cases[4]: NLP (all major tasks),Computer vision (Vision Transformer),Audio (Whisper),Multimodal (CLIP) pros[3]: Parallelizable (no recurrence),Long-range dependencies (attention),Scalable with data/model size cons[3]: Quadratic memory in sequence length,Requires massive data for training from scratch,Positional encoding limits context notes: Dominant architecture since 2017 (Attention Is All You Need). Sparse attention variants handle long sequences. - name: Generative Adversarial Network (GAN) type: Generative structure: Generator (creates fake samples) + Discriminator (distinguishes real vs fake). Min-max game. training: "Alternating: train D on real/fake, then train G to fool D. No explicit likelihood." use_cases[4]: Image synthesis (StyleGAN),Image-to-image translation,Super-resolution,Data augmentation pros[2]: "High-quality, sharp samples",No explicit likelihood modeling (flexible) cons[3]: "Training unstable (mode collapse, vanishing gradients)",Hard to evaluate,No explicit density notes: Diffusion models now dominate image generation; GANs still used for specific tasks (style transfer) - name: Autoencoder type: Representation learning structure: Encoder (compress to latent) → bottleneck → Decoder (reconstruct). Reconstruction loss trains end-to-end. variants[3]: Vanilla AE (dense layers),Variational Autoencoder (VAE) — probabilistic latent,Denoising AE — robust features use_cases[4]: Dimensionality reduction,Anomaly detection,Denoising,Generative modeling (VAE) pros[2]: Unsupervised pre-training possible,Learns compact representations cons[3]: VAE samples blurry,Simple AE doesn't learn useful latent space,Reconstruction loss not always semantic notes: Contrastive learning (SimCLR) often superior for representation learning selection_guide: tabular_data: FNN or Gradient Boosting (XGBoost/LightGBM) images: "CNN (ResNet, EfficientNet) or Vision Transformer" sequences_short: LSTM/GRU or Transformer (if enough data) sequences_long: Transformer with sparse attention or linear attention text_nlp: "Transformer (BERT for understanding, GPT for generation)" time_series: "Temporal CNN, LSTM, or Transformer (Informer, PatchTST)" image_generation: Diffusion model (Stable Diffusion) or GAN (legacy) anomaly_detection: Autoencoder or isolation forest