Docsity

CHEAT SHEET FOR UNIT 3, Cheat Sheet of Artificial Intelligence

Toggle sidebar
bg1
ANN UNIT 3
{Paradigms of Learning - Using training samples - Gradient Optimization Procedure- Batch Gradient Descent, Stochastic Gradient
Descent, Mini-Batch Gradient Descent - Hebbian learning rule – Delta learning rule,Convergence and local minima,
representational power of feed forward networks, hypothesis search space and inductive bias, generalization, overfitting and
stopping criterion-Error functions, Error minimizing procedures-Hebbian learning}
Paradigms of Learning
What does the topic say / What is the topic?
Paradigms of learning refer to the main approaches or methods through which neural networks (and other AI systems) learn
from data to solve problems. In simple terms, these are distinct “styles” of learning that define:
• What kind of data is used (labeled, unlabeled, rewards),
• How the learning process happens,
• What sorts of tasks or challenges are best solved by each paradigm.
The main paradigms include:
• Supervised Learning
• Unsupervised Learning
• Semi-Supervised Learning
• Reinforcement Learning
• Self-Supervised Learning
• Transfer Learning
• Few-Shot Learning
How does it work?
1. Supervised Learning
• The most common paradigm.
• The network is trained on input-output pairs (labeled data).
• The objective is to learn a mapping/function from inputs (features) to outputs (labels).
• Training adjusts weights to minimize error between network outputs and true labels.
o Example: Image classification, where labeled pictures are provided (“cat” or “dog”).
2. Unsupervised Learning
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28

Partial preview of the text

Download CHEAT SHEET FOR UNIT 3 and more Cheat Sheet Artificial Intelligence in PDF only on Docsity!

ANN UNIT 3

{Paradigms of Learning - Using training samples - Gradient Optimization Procedure- Batch Gradient Descent, Stochastic Gradient Descent, Mini-Batch Gradient Descent - Hebbian learning rule – Delta learning rule,Convergence and local minima, representational power of feed forward networks, hypothesis search space and inductive bias, generalization, overfitting and stopping criterion-Error functions, Error minimizing procedures-Hebbian learning}

Paradigms of Learning

What does the topic say / What is the topic?

Paradigms of learning refer to the main approaches or methods through which neural networks (and other AI systems) learn from data to solve problems. In simple terms, these are distinct “styles” of learning that define:

  • What kind of data is used (labeled, unlabeled, rewards),
  • How the learning process happens,
  • What sorts of tasks or challenges are best solved by each paradigm. The main paradigms include:
  • Supervised Learning
  • Unsupervised Learning
  • Semi-Supervised Learning
  • Reinforcement Learning
  • Self-Supervised Learning
  • Transfer Learning
  • Few-Shot Learning

How does it work?

1. Supervised Learning - The most common paradigm. - The network is trained on input-output pairs (labeled data). - The objective is to learn a mapping/function from inputs (features) to outputs (labels). - Training adjusts weights to minimize error between network outputs and true labels. o Example : Image classification, where labeled pictures are provided (“cat” or “dog”). 2. Unsupervised Learning

  • No labels are provided; only input data is used.
  • The network tries to find structure, patterns, or representations in the data.
  • Includes clustering (grouping similar data), dimensionality reduction, and feature learning. o Example : Autoencoders for compression, k-means clustering for grouping users. 3. Semi-Supervised Learning
  • Small amount of labeled data + large amount of unlabeled data are used together.
  • Combines the accuracy benefits of supervised and the flexibility of unsupervised.
  • Aids when labeling data is costly or difficult. o Example : Text classification using a few tagged and many untagged documents. 4. Reinforcement Learning
  • Learning by interacting with an environment and receiving rewards or penalties.
  • The network (agent) learns actions that maximize cumulative rewards.
  • Used for sequential decision-making and learning strategies. o Example : Playing chess or Go, controlling robots. 5. Self-Supervised Learning
  • A type of unsupervised learning where the system generates its own “labels.”
  • The network learns to predict part of the data from other parts (auxiliary tasks).
  • Important for representation learning, especially for text and images. o Example : Predicting next word in a sentence (language models). 6. Transfer Learning
  • Taking a model trained on one task and reusing/fine-tuning it for another, related task.
  • Saves time and resources, improves performance with less data. o Example : Using an ImageNet-trained model for detecting tumors in medical images. 7. Few-Shot Learning
  • Training models to generalize from only a very small number of examples.
  • Especially useful when labeled data is minimal. o Example : Teaching a network to recognize a new handwritten digit using just a few samples.

How does the topic help?

  • Foundation for All Modern AI : Knowing these paradigms helps understand which method is best for a particular data problem.
  • Semi-supervised is a mix: a few answers, lots of practice.
  • Reinforcement is learning from trial and error, like playing a new game and learning by rewards and losses.
  • Self-supervised is setting puzzles for yourself (like guessing missing words), and transfer learning is applying what you learned in one subject to another. Few-shot is mastering a skill after seeing just a couple of examples. This structure lets neural networks solve all sorts of problems, even with little or no labeled data, or in situations where learning has to happen dynamically.

Using Training Samples

What does the topic say / What is the topic?

Using training samples refers to the process by which neural networks learn from data examples provided by the user or environment. These examples—also called training data—include known input-output pairs (in supervised learning) or unlabeled samples (in unsupervised/semi-supervised learning). The model uses these samples to develop internal weights/parameters so it can generalize and predict new, unseen samples correctly.

How does it work?

1. Preparation of Data - Collection: Gather training samples relevant to the task (images, text, numbers, etc.). - Preprocessing: Standardize data using normalization (scaling values), augmentation (creating new variations like rotated images), and tokenization (breaking text into usable units). - Splitting: Divide the dataset into three main parts: o Training set: For directly teaching the model. o Validation set: For tuning model parameters (hyperparameters) during training. o Test set: For objectively evaluating the final model’s performance after training. 2. Training Process - Forward Pass: Each training sample flows through the layers, where it is multiplied by weights and transformed by activation functions. - Loss Calculation: The output prediction is compared to the true label using a loss function—a mathematical way to measure error (e.g., mean squared error for numbers, cross-entropy for classes). - Backward Pass (Backpropagation): The error is sent backward through the network, computing gradients that tell each weight how much it contributed to the error. - Weight Update: Weights are adjusted (optimized) in the direction that reduces error, using algorithms like SGD (stochastic gradient descent) or Adam. This step is repeated for each sample or batch of samples across many training cycles (epochs).

3. Optimization/Regularization - Algorithms: Common optimizers include SGD, Mini-batch GD (processes small groups of samples for better speed and stability), Adam, RMSprop. - Regularization: Added to prevent overfitting (model memorizing instead of generalizing). Includes dropout (randomly turning off nodes), weight decay (penalizing large weights), and early stopping (halting training when validation gets worse). 4. Validation and Testing - Validation: After each training cycle, model performance is evaluated using the validation set. This helps tune settings like learning rate, batch size, layer count, etc. - Testing: After training finishes, testing on a new set reveals how well the model generalizes to unseen data.

How does the topic help?

  • Ensures a model actually learns useful patterns from data—not just memorizing or guessing.
  • Lays a strong groundwork for model accuracy, generalization, and reliability.
  • Establishes clear methodology (data split, processing, and usage) for building and evaluating real-world neural networks.

Applications

  • Image/Sound/Text Recognition: Models learn to classify, segment, or process new images/sounds/text based on learned patterns from training samples.
  • Forecasting/Prediction: Analyzing financial records, meteorology, or healthcare data to predict outcomes from new instances.
  • Natural Language Processing: Language models trained on sample conversations or documents.

What does it help to find?

  • The best way to maximize learning from limited or noisy data.
  • How to test and verify the model’s ability to handle new cases—preventing overfitting and ensuring robustness.

What and how does it help in real-world situations?

  • Product Recommendation: Recommender systems use purchase history (training samples) to predict what new items a user might like.
  • Medical Diagnostics: Trained on thousands of medical records/past diagnoses to predict diseases in new patients.
  • Initialize weights (randomly, or by special methods: Xavier/Glorot for sigmoid/tanh, He for ReLU).
  • For each epoch: o Perform a forward pass (get predictions for current weights). o Calculate loss for all predictions. o Compute gradients using backpropagation. o Update weights using one of the gradient-based algorithms. o Use validation set to monitor generalization and tune hyperparameters. 5. Types of Gradient Descent
  • Batch Gradient Descent: Computes gradient over the entire dataset before each update. Accurate but slow and memory- expensive.
  • Stochastic Gradient Descent (SGD): Updates weights after every single sample. Fast, can escape local minima, but updates are noisy.
  • Mini-Batch Gradient Descent: Updates weights after small groups (mini-batches) of samples—blends the stability of batch with the speed of SGD. This is used most in practice. 6. Advanced Optimizers
  • Momentum: Adds a velocity term, helping jump across small minima and smooth oscillations.
  • RMSProp: Adapts learning rate for each parameter individually, using a moving average of squared gradients.
  • Adam: Combines momentum and RMSProp. Maintains running averages of both gradients and their squares, with adaptive learning rates for each parameter. 7. Learning Rate Scheduling
  • Uses schedules to reduce learning rate as training progresses, for more stable convergence. o Constant, step decay, exponential decay, adaptive methods.

How does the topic help?

  • Provides the mathematical backbone to efficiently solve error minimization in networks.
  • Ensures that neural networks actually learn optimally and generalize to new data.
  • Offers practical ways to balance speed, efficiency, and performance for any dataset or problem.

Applications

  • All neural network training: Whether for images, speech, text, or numbers.
  • Deep learning: CNNs, RNNs (for language), transformers (for conversation/translation), etc.
  • Optimization in broader ML: Logistic regression, linear regression, support vector machines.

What does it help to find?

  • The “best” weights for a network model—those that minimize the prediction error for the given task/data.
  • Optimum parameters to ensure the model makes the least mistakes possible.

What and how does it help in real-world situations?

  • Medical diagnosis: Find network parameters that distinguish between healthy and unhealthy cases.
  • Self-driving cars: Minimize steering/braking mistakes by adjusting parameters to fit driving data.
  • Personalized recommendations: Improving accuracy of product/user matches by reducing error in predictions.

Quick Teacher’s Explanation

Gradient optimization is like finding the quickest way down a hilly landscape (error surface) to the bottom (least error). Neural networks use gradients (directions where error drops fastest) and keep stepping that way, gently nudging their weights over and over, until the answers get as accurate as possible. Batch methods look at the whole map, stochastic methods leap after each small step, and mini-batch does a bit of both—they all help your model “learn” efficiently.

Batch Gradient Descent

What does the topic say / What is the topic?

Batch Gradient Descent is a fundamental optimization technique used in training machine learning models, especially neural networks. It updates the model’s parameters (weights and biases) by calculating the gradient of the loss/cost function over the entire training dataset before each update step. This ensures stable convergence but can be computationally expensive for large datasets.

How does it work?

  1. Initialization: o Initialize all weights and biases randomly or by using heuristics (like Xavier or He initialization).

What and how does it help in real-world situations?

  • Stable Learning: Ensures all learnt patterns reflect the entire dataset, not just a subset, leading to globally representative models.
  • Example: If training a model to predict house prices from a dataset of 10,000 examples, Batch Gradient Descent will process all 10,000 for every update, ensuring each feature’s influence is considered.

Quick Teacher’s Explanation

Batch Gradient Descent acts like a careful examiner who checks every single student’s answer before giving feedback. It uses the whole class’s answers to decide the best correction, so its updates are steady but slow (since it waits for all responses before acting). It’s reliable and accurate for small datasets, but not practical for huge ones because it must look at all examples before moving ahead. That’s why for big data, faster methods like Stochastic or Mini-batch Gradient Descent are used.

Stochastic Gradient Descent (SGD)

What does the topic say / What is the topic?

Stochastic Gradient Descent (SGD) is an optimization algorithm commonly used to train neural networks and other machine learning models. Unlike Batch Gradient Descent, which processes the entire dataset for each update, SGD updates model parameters for each individual training sample. “Stochastic” means random—SGD randomly selects samples to calculate gradients, which speeds up learning and allows the algorithm to handle very large datasets efficiently.

How does it work?

  1. Initialization: o Randomly initialize weights and biases.
  2. Randomization: o Shuffle the training data to introduce randomness and avoid biased updates.
  3. For Each Epoch: o For each sample (x, y) in the training set: ▪ Forward Pass: Compute the model’s output for the current input using current weights. ▪ Loss Calculation: Find the loss between output and true label. ▪ Gradient Calculation: Compute the gradient of the loss w.r.t. model parameters using only this sample.

▪ Parameter Update: Update parameters:𝑤new = 𝑤old − 𝜂 ⋅ 𝜕(loss) 𝜕𝑤  This update is done after every single sample (not after a whole batch). o Repeat for desired number of epochs.

  1. Because each update only looks at one sample: o The learning curve is noisy (can jump up and down). o The algorithm can “escape” shallow local minima and find better general solutions.

How does the topic help?

  • Enables model training on extremely large datasets that would not fit in memory.
  • Allows faster, more frequent updates, making learning scalable and practical in big-data and streaming contexts.
  • Introduces randomness that sometimes helps models escape poor solutions and find better minima.

Applications

  • Deep learning for image, speech, and text data (especially with millions of samples).
  • Online learning systems (models updated in real-time, e.g., recommendations, fraud detection).
  • Any scenario where instant, small updates are needed instead of waiting for full-dataset computations.

What does it help to find?

  • The near-optimal set of parameters by continuously updating with new samples, yielding good generalization, particularly for massive, real-world datasets.

What and how does it help in real-world situations?

  • Web Search/Ad Serving: Models can be updated after every click, impression, or search.
  • Dynamic Content Recommendation: Real-time learning as users interact.
  • Continuous Quality Improvement: Models can quickly adapt to recent changes in data (e.g., trends, new user behaviors).

Quick Teacher’s Explanation

  • Reduces noise in updates while allowing some randomization for improved generalization.

Applications

  • Training deep neural networks for computer vision (image recognition, segmentation), natural language processing (translation, chatbots), and more.
  • Large-scale learning on datasets that may not fit fully in memory, but can use reasonable chunks.
  • Any modern neural network framework and platform (e.g., TensorFlow, PyTorch) uses mini-batch gradient descent by default.

What does it help to find?

  • Achieves effective error minimization while controlling computational resources, almost as well as batch but much faster and with better generalization.

What and how does it help in real-world situations?

  • Allows for scalable training—handling millions of images/text samples efficiently.
  • Gives faster convergence than batch, less noisy than pure stochastic—ideal for real-world projects with large but finite datasets.
  • Example: Training a voice assistant model on millions of user recordings by splitting data into manageable mini-batches and continuously updating model weights.

Quick Teacher’s Explanation

Mini-batch training is like a teacher taking a stack of a few papers at a time, checking them, making corrections, and updating the answer key after each small stack. It’s faster than waiting for the whole class (batch) and smarter than looking at just one (stochastic)—it’s the “just right” method for both speed and accuracy, which is why real neural networks use it most!

Hebbian Learning Rule

What does the topic say / What is the topic?

The Hebbian Learning Rule is an unsupervised learning principle, inspired by biological neural processes, stating that the connection (weight) between two neurons strengthens when both activate simultaneously. This is often summarized as “cells that fire together, wire together.” It is a local learning rule, meaning the update depends only on the activities of the pre- and post-

synaptic neurons, without a global error term. Hebbian learning is foundational to understanding associative memory, self- organizing maps, and feature discovery in both biological and artificial neural networks.[85][86]

How does it work?

  • Basic Principle: When input neuron 𝑖 and output neuron 𝑗 are both active, the weight 𝑤𝑖𝑗 between them increases. Δ𝑤𝑖𝑗 = 𝜂 ⋅ 𝑥𝑖 ⋅ 𝑦𝑗 Where: o Δ𝑤𝑖𝑗 is the change in synaptic weight, o 𝜂 is the learning rate, o 𝑥𝑖 and 𝑦𝑗 are activations of neuron 𝑖 and 𝑗.
  • Learning Steps: o Initialize all weights (often to zero). o For each training input: ▪ Apply input 𝑥 and get output 𝑦. ▪ Update each 𝑤𝑖𝑗 according to formula. o (In advanced versions) Apply normalization to prevent weights from growing without bound (e.g., Oja’s rule).
  • Biological Connection: Reflects actual processes in brain learning and synaptic plasticity—important for memory formation.

Example: Simple AND Gate (Bipolar Inputs)

  • Inputs and targets are converted to - 1, 1 representations.
  • Initial weights and bias = 0.
  • For each input-output pair, adjust weights according to Hebb rule, accumulating the changes after each input.

How does the topic help?

  • Provides an intuitive, biologically-plausible mechanism for associative learning and memory.
  • Forms theoretical foundations for material and sensory memory models in neural networks and cognitive science.
  • Inspires development of more advanced rules (Oja’s rule, STDP) that enhance biological realism and stability.

desired target output by adjusting the weights incrementally in proportion to this error. It is based on the principle of gradient descent to minimize the error function, especially when the activation function is linear or differentiable.

How does it work?

  • Basic Concept: Adjust weights 𝑤𝑖 to reduce the error between the output 𝑦 and the target 𝑡. The update rule is: Δ𝑤𝑖 = 𝜂(𝑡 − 𝑦)𝑥𝑖 Here: o 𝜂 is the learning rate, o (𝑡 − 𝑦) is the error term (called delta), o 𝑥𝑖 is the input associated with weight 𝑤𝑖.
  • For neurons with non-linear activation: The error term is modified by the derivative of the activation function 𝑓′(𝑧): 𝛿 = (𝑡 − 𝑦) × 𝑓′(𝑧) Weight update becomes: Δ𝑤𝑖 = 𝜂𝛿𝑥𝑖
  • Learning Steps: o Initialize weights randomly. o For each training sample: ▪ Forward propagate input to get current output. ▪ Calculate error 𝑡 − 𝑦. ▪ Calculate delta 𝛿 (considering activation derivative if nonlinear). ▪ Update weights using Δ𝑤𝑖. o Repeat until error converges or max epochs reached.

How does the topic help?

  • Forms the foundation for training perceptrons and simple neural networks.
  • Enables direct minimization of output error through incremental, supervised weight adjustment.
  • Serves as a basis for backpropagation in multilayer networks.

Applications

  • Early neural models and simple linear classification tasks.
  • Training single-layer networks for regression or classification.
  • Foundation of weight updating rules in more complex deep learning.

What does it help to find?

  • Weight configurations minimizing the difference between predicted and actual outputs.
  • Reduction of mean squared error in simple networks.

What and how does it help in real-world situations?

  • Suitable for tasks where linear relationships exist between inputs and outputs (predicting house prices, basic pattern recognition).
  • Helps improve predictions iteratively by learning from mistakes.

Quick Teacher’s Explanation

Delta Rule is like giving your model a small push in the right direction whenever it makes a mistake—correcting weights based on how wrong it is and what inputs caused the mistake. It’s simple and effective for networks where outputs depend mostly on weighted sums, and it’s the stepping stone to teaching bigger, deeper networks how to learn.

Convergence and Local Minima

What does the topic say / What is the topic?

Convergence in neural network training refers to the process where the optimization algorithm steadily reduces the error or loss function, eventually settling on a set of parameters (weights) that minimize this error. Local minima are points in the loss landscape where the error is lower than in neighboring points but not necessarily the absolute lowest error (global minimum). These concepts are fundamental to understanding whether and how effectively a neural network learns during training.

How does it work?

What does it help to find?

  • Helps identify optimal or near-optimal weight configurations during training.
  • Ensures neural networks reach satisfactory performance without excessive training.
  • Helps detect when a model might be trapped in suboptimal solutions.

What and how does it help in real-world situations?

  • Improves reliability of AI systems by preventing premature stopping or overtraining.
  • Helps in developing robust models that generalize well across data.
  • Example: In autonomous driving, convergence ensures the model safely generalizes from training to real-world scenarios despite complex sensor input data.

Quick Teacher’s Explanation

Convergence is the point where the network finishes learning and the errors stop dropping; we want it to reach the lowest possible error (global minimum). But the path isn’t always smooth—the network might get stuck in “local minima,” like a hiker stuck in small valleys before reaching the lowest valley. Smart training methods help the network escape those traps and find the

Representational Power of Feedforward Networks

What does the topic say / What is the topic?

The representational power of feedforward neural networks (FFNNs) refers to their ability to approximate or represent complex functions, patterns, and relationships in data. This power determines how well a network can model tasks such as classification, regression, and complex pattern recognition. The Universal Approximation Theorem underpins the theory that FFNNs can approximate any continuous function to any degree of accuracy given sufficient neurons and appropriate activation functions.

How does it work?

  • Structure: FFNNs comprise layers of interconnected neurons where information flows from input to output without cycles.
  • Universal Approximation Theorem: A feedforward neural network with at least one hidden layer and enough neurons can approximate any continuous function on compact subsets of ℝ𝑛^ arbitrarily well. This means theoretically, FFNNs can represent highly complex mappings.
  • Non-linearity: The use of non-linear activation functions (ReLU, sigmoid, tanh) in hidden layers allows FFNNs to capture non-linear relationships that simple linear models cannot.
  • Hierarchical Feature Learning: Through multiple layers, networks learn hierarchical features. In image processing, early layers detect edges, intermediate layers detect shapes, and deeper layers recognize objects.
  • Complex Function Representation: FFNNs can represent polynomials, trigonometric functions, and piecewise continuous functions, enabling them to adapt to a broad variety of tasks.

How does the topic help?

  • Establishes the theoretical foundation for applying FFNNs in diverse applications.
  • Explains why deeper networks tend to perform better on complex tasks.
  • Encourages choosing appropriate architecture (depth, width) based on problem complexity.

Applications

  • Regression and classification in finance and healthcare.
  • Image and speech recognition.
  • Natural language processing and machine translation.
  • Robotics and control systems.

What does it help to find?

  • The ability to model complex, multi-dimensional patterns.
  • Solutions to problems that require mapping nonlinear relationships.
  • An understanding of network design trade-offs (depth vs. width).

What and how does it help in real-world situations?

  • Enables practical AI applications by approximating intricate relationships in data.
  • Supports development of efficient models for real-world tasks requiring complex decision-making.