Fundamentals of ML, DL, and GEN AI

Sajjad Rahman - Oct 31 - - Dev Community

This guide covers the fundamentals of Machine Learning (ML), Deep Learning, and Generative AI, including an overview of foundation models (FMs) and their types. Understanding these areas can aid in preparing for exams like the AWS Certified AI Practitioner (AIF-C01).

[1] Machine Learning

ML

Training Data

To build a machine learning model, we must have good data. The process starts with collecting and preparing training data, which can be labeled or unlabeled depending on the dataset and the problem we are trying to solve. There are some variations in the data:

  • Labeled data: Each instance or example is associated with a target variable or label representing the desired output or classification.

  • Unlabeled data: Data that does not have any associated label.

  • Structured data: Data stored in rows and columns following a predefined format, like tabular data (CSV) or time series (e.g., stock prices, weather data). Traditional ML models often use structured data.

  • Unstructured data: Data with no predefined format, like text, images, and audio. Advanced machine learning algorithms are required to extract meaningful patterns and insights from this type of data.

data

After collecting data, we select a machine-learning algorithm.

ML Model

Traditional ML models are divided into three categories: Supervised Learning, Unsupervised Learning, and Reinforcement Learning.

  • Supervised Learning: Trained with labeled data, it learns a mapping function to make precise predictions when new data is provided.

  • Unsupervised Learning: Trained with unlabeled data, it aims to find patterns, structures, or relationships within the input data.

  • Reinforcement Learning: Known as semi-supervised learning, where only a portion of training data is labeled. The machine learns from feedback, in the form of rewards or penalties, to improve its decision-making over time.

Inferencing

The process of evaluating a model's performance by making predictions or decisions is called inferencing.

  • Batch Inferencing: When a computer processes a large set of data, like images or text, all at once. It’s often used for data analysis tasks where accuracy is more important than speed.

  • Real-Time Inferencing: When a computer makes quick decisions based on new data as it arrives. This is essential for applications that need instant responses, like chatbots.

[2] Deep Learning

Deep learning is a subset of machine learning—an advanced version of traditional machine learning.

NN

Neural Networks

Neural networks are the backbone of deep learning and are inspired by the human brain.

In neural network architecture, nodes are organized into layers, including an input layer, one or more hidden layers, and an output layer.

Deep learning is widely used in these two fields:

  • Computer Vision: A field in AI that enables computers to interpret and understand images and videos, allowing for tasks like image classification, object detection, and image segmentation.

  • Natural Language Processing (NLP): AI focused on the interaction between computers and human language. It enables tasks like text classification, sentiment analysis, machine translation, and language generation.

[3] Generative AI

Gen AI

Generative AI refers to AI models that create new content based on existing data or patterns. Generative AI models, known as foundation models (FMs), are pre-trained on large datasets. Unlike traditional ML, which requires separate labeled datasets for each model, a single FM can be adapted for multiple tasks, including text generation, summarization, information extraction, image creation, chatbots, and question answering. FMs can also serve as the foundation for developing more specialized models.

Foundation Model (FM) Lifecycle

  1. Data Selection: Large amounts of unlabeled data, like images or text, are collected for pre-training since they are easier to obtain than labeled data. FMs are trained on massive, diverse datasets.

  2. Pre-training: FMs use self-supervised learning, which doesn’t require labeled data, to learn the meanings and relationships within the data. Continuous pre-training on new data expands the model’s knowledge.

  3. Optimization: Techniques like prompt engineering, retrieval-augmented generation (RAG), and fine-tuning on specific tasks help refine the model for better performance.

  4. Evaluation: The model is tested using metrics and benchmarks to assess its effectiveness and alignment with business needs.

  5. Deployment: Once the model meets performance standards, it is integrated into applications, APIs, or systems in the target environment.

  6. Feedback and Continuous Improvement: After deployment, performance is monitored, and user feedback is collected to improve the model through further fine-tuning, pre-training, or re-training. This feedback loop ensures the model stays accurate and relevant.

Amazon Bedrock provides access to a choice of high-performing FMs from leading AI companies like AI21 Labs, Anthropic, Cohere, Meta, Mistral AI, Stability AI, and Amazon.

Different Types of Generative Foundation Models (FMs) in AI

  • Large Language Models (LLMs): LLMs, often based on transformer architecture, are trained on vast text data to understand and generate human-like text. It uses tokens, embeddings, and vectors to capture word relationships, allowing tasks like text generation, question answering, and summarization.

  • Diffusion Models: It is known text-to-image generation . This model starts with noise, and then progressively refines it to produce clear outputs, for example, images. The process can be forward and reverse diffusion.

  • Multimodal Models: These models handle different types of data, like text and images, to create new content. They can, for example, generate captions for images or create graphics from text prompts. They are useful in applications like video captioning, question answering, and translating content.

  • Generative Adversarial Networks (GANs): GANs use two neural networks (a generator and discriminator) that compete to produce realistic synthetic data. The generator creates new data, and the discriminator tries to differentiate real from generated data.

  • Variational Autoencoders (VAEs): VAEs use an encoder to compress data into a latent space and a decoder to reconstruct it. VAEs are a type of generative model that combines ideas from autoencoders (a type of neural network) and variational inference (a technique from Bayesian statistics).

Reference: Standard Exam Prep Plan: AWS Certified AI Practitioner (AIF-C01)

. . . . . . . . . . . . . . . .
Terabox Video Player