Docsity

Generative Ai and machine learning, Study notes of Artificial Intelligence

Toggle sidebar
bg1
Define the following
Answer in 1–2 sentences each
1. What is a vector?
Avectoris an ordered collection of numerical values used to represent
data or features in machine learning. For example,[2, 5, 7]can represent
three features of an object.
2. Write one benefit of the reparameterization trick.
Thereparameterization trickallows gradients to pass through a
random sampling operation during VAE training. This makes the encoder
parameters trainable using backpropagation.
3. Why are VAEs considered generative models?
Variational Autoencoders (VAEs)are generative models because they
learn the probability distribution of the training data and can generate
new data by sampling from the learned latent space.
4. Give two real-world applications of Generative AI.
Two applications areAI-generated images/designsandautomated
text generation, such as creating articles, summaries, or chatbot
responses.
5. State one difference between Generative and Discriminative
models.
Agenerative modellearns how data is generated and can create new
samples, whereas adiscriminative modelmainly learns the boundary or
relationship needed to classify or predict data.
6. What is the purpose of an autoencoder?
An autoencoder learns toencode input data into a lower-dimensional
representation and reconstruct the original inputfrom that
representation. It is commonly used for dimensionality reduction, feature
learning, and data denoising.
7. List the different types of RNNs.
Common types includeVanilla RNN, LSTM, GRU, Bidirectional RNN,
and Stacked/Deep RNN.
8. What do latent variables represent in machine learning?
Latent variables representhidden or underlying features of data that
cannot be directly observed. They provide a compact representation of
important information in the input.
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

Partial preview of the text

Download Generative Ai and machine learning and more Study notes Artificial Intelligence in PDF only on Docsity!

Define the following

Answer in 1–2 sentences each

1. What is a vector? A vector is an ordered collection of numerical values used to represent data or features in machine learning. For example, [2, 5, 7] can represent three features of an object. 2. Write one benefit of the reparameterization trick. The reparameterization trick allows gradients to pass through a random sampling operation during VAE training. This makes the encoder parameters trainable using backpropagation. 3. Why are VAEs considered generative models? Variational Autoencoders (VAEs) are generative models because they learn the probability distribution of the training data and can generate new data by sampling from the learned latent space. 4. Give two real-world applications of Generative AI. Two applications are AI-generated images/designs and automated text generation , such as creating articles, summaries, or chatbot responses. 5. State one difference between Generative and Discriminative models. A generative model learns how data is generated and can create new samples, whereas a discriminative model mainly learns the boundary or relationship needed to classify or predict data. 6. What is the purpose of an autoencoder? An autoencoder learns to encode input data into a lower-dimensional representation and reconstruct the original input from that representation. It is commonly used for dimensionality reduction, feature learning, and data denoising. 7. List the different types of RNNs. Common types include Vanilla RNN, LSTM, GRU, Bidirectional RNN, and Stacked/Deep RNN. 8. What do latent variables represent in machine learning? Latent variables represent hidden or underlying features of data that cannot be directly observed. They provide a compact representation of important information in the input.

9. What is the role of the discriminator in GANs? The discriminator in a Generative Adversarial Network (GAN) distinguishes between real training data and fake data produced by the generator. 10. What is the role of the decoder in an autoencoder? The decoder takes the compressed latent representation produced by the encoder and reconstructs it into data that resembles the original input. 11. What is the role of the encoder in an autoencoder? The encoder converts the original input into a lower-dimensional latent representation by extracting its important features. 12. Name one use case of ChatGPT in education. ChatGPT can be used as a personalized learning assistant to explain concepts, answer questions, generate practice problems, and provide study guidance. 13. What type of data does DALL·E generate? DALL·E primarily generates images from textual descriptions (text prompts). 14. What is the reconstruction loss in autoencoders? Reconstruction loss measures the difference between the original input and the reconstructed output. A lower reconstruction loss means the autoencoder is reconstructing the input more accurately. 15. Define KL Divergence in simple words. KL Divergence measures how different one probability distribution is from another reference probability distribution. In a VAE, it helps keep the learned latent distribution close to a desired distribution, usually a standard normal distribution. Short Notes

(Write about a page each)

1. What is Generative AI? Give examples of its outputs. Generative Artificial Intelligence (Generative AI) is a branch of artificial intelligence that can learn patterns from existing data and use

generated information should be verified because AI systems can sometimes produce incorrect or misleading content.

2. List 10 GenAI tools and explain their use in a single line. No . GenAI Tool Main Use 1 ChatGPT Generates and understands text, answers questions, and assists with coding. 2 Google Gemini Provides AI assistance for text, reasoning, coding, and multimodal tasks. 3 DALL·E Generates images from natural-language descriptions. 4 Midjourney Creates artistic and highly detailed images from prompts. 5 GitHub Copilot Assists programmers by generating and completing code. 6 Claude Performs text generation, analysis, summarization, and reasoning. 7 Microsoft Copilot Provides AI assistance for productivity and general tasks. 8 Runway Generates and edits AI-based video content. 9 ElevenLabs Generates realistic AI voices and speech. 10 Canva AI Helps create designs, images, presentations, and other visual content. 3. Applications of Generative AI in text, images, and code

Generative AI has applications across many areas because it can automatically create different types of content. A. Text Generation Generative AI can create:  Articles  Emails  Reports  Stories  Summaries  Chatbot responses  Educational notes  Translations For example, a student can provide a topic such as "Explain neural networks" , and an AI system can generate an explanation with examples. B. Image Generation AI image generators can create images from text prompts. For example: Prompt: "A futuristic smart city at night" ↓ Generative AI ↓ AI-generated Image Applications include:  Advertising

 Generative language models Training Data ↓ Generative Model ↓ Learn Data Distribution ↓ Generate New Data Discriminative Models A discriminative model learns how to distinguish between different classes or predict an output from an input. Examples:  Logistic Regression  Decision Tree  SVM  Many classification neural networks Input Data ↓ Discriminative Model ↓ Decision Boundary ↓ Class A / Class B Comparison Feature Generative Model Discriminative Model Main purpose Generate new data Classify/predict

Feature Generative Model Discriminative Model Learns Data distribution Relationship/ boundary Output New samples Class/prediction Example VAE, GAN SVM, Logistic Regression Can generate data? Yes Usually no Example task Generate face Identify face Therefore, generative models focus on "How could this data be generated?" , while discriminative models focus more on "Which class does this data belong to?"

5. Explain the working of autoencoders with an example. An autoencoder is a neural network designed to learn a compact representation of input data and reconstruct the original data. It consists mainly of two parts: 1. Encoder 2. Decoder Architecture Input │ ▼ ┌─────────┐ │ Encoder │ └────┬────┘

 = original input  = reconstructed output Autoencoders are used for:  Dimensionality reduction  Denoising  Feature extraction  Anomaly detection  Data compression

6. Limitations of traditional autoencoders Traditional autoencoders are useful for learning compressed representations, but they have several limitations. 1. Not naturally generative A standard autoencoder mainly learns to reconstruct existing data. Its latent space is not necessarily organized in a way that makes random sampling produce realistic new examples. 2. Poor latent-space organization Similar inputs may not always produce smoothly organized latent representations. 3. Overfitting If the model has too much capacity, it can simply memorize the training data instead of learning useful features. 4. Reconstruction limitations The decoder may produce blurry or imperfect outputs, especially for complex images. 5. Loss of information If the latent space is too small, important information may be lost during compression. 6. Sensitive to architecture Performance depends heavily on the network architecture, latent-space size, activation functions, and training process. 7. Not suitable for every type of data

A basic autoencoder may not handle sequential, image, or structured data optimally without specialized architectures. To address some of these problems, advanced architectures such as Variational Autoencoders (VAEs), denoising autoencoders, convolutional autoencoders, and sparse autoencoders are used.

7. Latent space and its importance in generative models Latent space is a hidden mathematical representation in which important features of data are encoded. For example, an image of a human face may contain thousands or millions of pixels, but its latent representation may capture meaningful characteristics such as:  Face shape  Hair  Age-related features  Pose  Expression Original Data ↓ Encoder ↓ Latent Space ↓ Important Features In generative models, latent space is extremely important because new data can be generated by sampling points from it. For example: Latent Point A ──→ Face A Latent Point B ──→ Face B Latent Point C ──→ Face C If the latent space is well organized, nearby points can represent similar outputs.

If the categories are: Cat, Dog, Horse Dog becomes: [0, 1, 0] Advantages  Simple representation  Does not imply numerical ordering  Easy for machine learning algorithms to process Disadvantage For a large number of categories, one-hot encoding can produce very large vectors containing mostly zeros. This is called a sparse representation.

9. Explain Latent Variable Model and its benefits. A Latent Variable Model (LVM) is a statistical or machine learning model that assumes observed data is influenced by hidden variables called latent variables. For example, a photograph is observable, but factors such as pose, lighting, expression, and identity can be considered hidden factors. Latent Variables ↓ Generative Process ↓ Observed Data In mathematical form: where:  = latent variable  = observed data VAEs are an important example of latent variable models. Benefits

  1. Data compression High-dimensional data can be represented using fewer latent variables.
  2. Feature learning The model can automatically discover useful hidden features.
  3. Data generation New data can be generated by sampling latent variables.
  4. Pattern discovery Hidden structures within datasets can be identified.
  5. Dimensionality reduction Complex data can be mapped to a lower-dimensional space. Latent variable models are therefore important in generative AI because they provide a way to understand and generate data through hidden representations. 10. Sampling in VAEs vs. simple autoencoders Sampling is an important difference between a traditional autoencoder and a Variational Autoencoder. Simple Autoencoder A traditional autoencoder maps an input directly to a fixed latent vector. Input ↓ Encoder ↓ z ↓ Decoder ↓ Output The latent vector is deterministic for a given input. VAE A VAE's encoder produces parameters of a probability distribution:

Why is it needed? Without KL regularization, the latent space could become irregular and difficult to sample from. KL divergence encourages the latent distributions to remain close to a known prior. Encoder ↓ μ and σ ↓ KL Divergence ↓ Regularized Latent Space ↓ Sampling Thus, KL divergence helps make the VAE's latent space smooth, continuous, and useful for generation.

12. Explain mode collapse with an example. Mode collapse is a problem commonly associated with GANs where the generator produces only a limited variety of outputs instead of representing the full diversity of the training data. Suppose a GAN is trained using images of: Cats Dogs Birds Rabbits A healthy generator should generate different types of animals. However, during mode collapse, it might learn to generate almost only: Cat Cat Cat

Cat even though the training dataset contains many different categories. Why does it happen? The generator may discover a small number of outputs that successfully fool the discriminator. It then repeatedly produces those outputs rather than learning the entire data distribution. Generator ↓ Few patterns ↓ Repeated outputs ↓ Low diversity Problems  Low output diversity  Poor representation of training data  Repetitive generated content  Reduced quality of the generative model Researchers use different GAN architectures and training techniques to reduce mode collapse. Detailed Answers

1. Explain the concept of Generative AI and compare it with traditional AI. Discuss its importance in business and creativity. Introduction Generative Artificial Intelligence (Generative AI) refers to AI systems capable of creating new content based on patterns learned from existing data. The generated content may include text, images, audio, video, code, or other forms of digital information.

Feature Traditional AI Generative AI Main purpose Analyze/predict/ classify Create new content Output Prediction or classification Text, image, audio, video, code Example Spam classifier AI email generator Main task Decision-making Content creation Creativity Limited Can produce novel combinations Example models Decision trees, SVM GANs, VAEs, language models Example Traditional AI: Email → Spam Classifier → Spam / Not Spam Generative AI: Prompt → Generative AI → New Email Importance in Business

1. Marketing Businesses can generate:  Advertisements  Product descriptions  Social-media posts  Marketing emails 2. Customer Support

AI chatbots can answer customer questions and provide automated support.

3. Software Development Generative AI can help developers:  Generate code  Debug programs  Write documentation  Generate test cases 4. Product Design Companies can generate different product concepts before creating physical prototypes. 5. Data Analysis Generative AI can summarize reports and convert complex information into easier language. Importance in Creativity Generative AI provides creative assistance in:  Music composition  Story writing  Graphic design  Film production  Photography concepts  Game development  Animation For example, a designer can provide: "Design a futuristic electric car." The AI can generate multiple design concepts. Advantages  Saves time