Which statement correctly describes the main difference between generative and discriminative models?
Think about what each model tries to understand about the data and labels.
Generative models learn how data and labels come together (joint probability), enabling them to generate new data. Discriminative models focus on predicting labels from data (conditional probability).
You want to create a model that can generate realistic images of cats. Which type of model should you choose?
Think about which model type can create new data samples.
Generative models like VAEs learn to create new data similar to training data, making them suitable for image generation.
Which metric is commonly used to evaluate the quality of images generated by a generative model?
Consider metrics designed specifically for generated images.
Inception Score measures how realistic and diverse generated images are, making it popular for generative model evaluation.
Given this code snippet training a discriminative model, what is the likely cause of the error?
model = LogisticRegression()
model.fit(X_train, y_train)
preds = model.predict(X_test)
print(f"Accuracy: {accuracy_score(y_test, preds)}")Error message: ValueError: Found input variables with inconsistent numbers of samples
Check the shapes of training data and labels.
The error indicates that the features and labels arrays do not have matching sample counts, which is required for training.
What is the output of this Python code simulating a simple generative model sampling from a Gaussian distribution?
import numpy as np np.random.seed(42) mean = 0 std_dev = 1 samples = np.random.normal(mean, std_dev, 3) print([round(s, 2) for s in samples])
Run the code or recall numpy's normal distribution output with seed 42.
With seed 42, np.random.normal generates approximately [0.4967, -0.1383, 0.6477], rounded to [0.5, -0.14, 0.65].