Generative Modeling p\left( x \right) ~2014 onwards Generative modeling is a branch of machine learning that involves training a model to produce new data that is similar to a training dataset. Then we can sample (draw new data points) from this model to create new data from the learned probability distribution. P(x) tells us how likely a given image is under the learned distribution of real images. Once model is trained, we generate new samples by drawing from P(x). GenAI / Mid 01 — Generative modeling Each data point in training data is known as observation, each observation consists of many features. A generative must also be probabilistic rather than deterministic because we want to generate many different variations in output instead of getting same output every time. Every generative model has a random component that influences individual samples generated by model. Generative modeling doesn’t requires dataset to be labelled Generative AI applications Art and design Music composition Content creation Virtual words Fashion and product design Advantages of Generative AI Diverse applications in many domains Foundation models can handle multiple tasks Can be fine-tuned with comparatively lesser data Can be Personalized Enhances productivity Disadvantages of Generative AI Deepfakes Poor quality data can lead to misleading outputs Erosion of human creativity Job displacement in certain fields Models may inherit bias and discrimination Can be exploited for cyber threats Consume significant computational power Generative modeling framework We have a dataset of observations X We assume observations have been generated according to some unknown distribution P_{data} We want to build a generative model P_{model} that mimics P_{data} we then sample from P_{model} to generate observations that appear to have been drawn from P_{data} Discriminative Modeling p(y|x) Branch of machine learning where we focus on distinguishing between different classes of data. Aims to model the probability of a label y given some observation x. During training each observation usually has a label. A discriminative models (like classifiers) focus on learning the boundary between classes, but a generative model understands the full landscape of the data and can create new samples from that learned distribution. What is the idea behind latent vectors? This domain is also referred to as representation learning. If you wanted to describe your appearance to someone and the other person doesn’t knows what you look like, you wouldn’t start stating color of pixel 1, pixel 2, … , pixel n. you would describe high level features that describe a 'group' of pixels such as I have curly hair and green eyes. In other words, each point in the latent space is a representation of some high-dimensional observation Core probability in Generative modelling Sample space: complete set of all possible values an observation x can take Probability density function: assigns probabilities of different values in sample space bw 0-1 Parametric modeling: structured technique to estimate P_{model}\left( x \right) using a finite set of parameters θ Likelihood function: how likely given a set of parameters θ\,explains observed data (x) Maximum likelihood estimation: finds the set of parameters that maximizes likelihood of observing the data (x) Generative models taxonomy Explicit Tractable Models: directly models the PDF making, we can compute exact probability of any given data point. e.g. Autoregressive models, normalizing flow models, GPT, Pixel CNNs. Explicit Approximate Models: Approximate PDF rather than computing it exactly by introducing latent variables to simplify data representations. e.g. VAE, EBMs, Diffusion models Implicit Models: Do not estimate PDF, instead generate data using a stochastic process. e.g. GANs (They never explicitly compute PDF, instead they learn to generate data using competition bw two NNs.) GenAI / Mid 01 — Generative modeling GenAI / Mid 01 — Neural network foundations — notes Feed-Forward Neural Networks Is a multilayer network, sometimes also called multi-layer perceptrons (MLP), units are connected with no cycles. Each layer is fully connected GenAI / Mid 01 — Neural network foundations There is a single matrix W for weights of the entire layer for parallel computation We don’t count the input layer when numbering layers, but do count the output layers Some notations: W^{[1]}\,means weight matrix for first hidden layer b^{[1]}\,means bias vector for first hidden layer n_{j} means number of units at layer j a^{[i]} means output from layer I 0^{th} layer is for inputs reffered to as a^{[0]} \hat{y}\,means predicted value (think\,of\,\hat{{}}\,as\,topi\,xd\,output(model\,output)) Training Neural Nets Goal of training is to learn W and b for each layer that make \hat{y} for each training observation as close as possible to true y Error function: computes the difference between y and \hat{y} Loss function: Defines how error value is…