Logistic regression also known as logit regression or binary classification

Let the data be D = {($x_1$, $y_1$), ($x_2$, $y_2$), …, ($x_n$, $y_n$)} where $y_i \in {0, 1}$ is the binary label of the feature vector $x_i$. Then the logistic regression model is defined as: $$P(y_i = 1 | x_i) = \frac{1}{1 + e^{-w^T x_i+b}}$$ $$P(y_i = 0 | x_i) = \frac{1}{1 + e^{w^T x_i+b}}$$ where $w$ is the parameter vector. Note that $$P(y_i = 1 | x_i) + P(y_i = 0 | x_i) = 1$$ ...

January 1, 2025 · Victor

Loss function (L)

Let the data be D = {($x_1$, $y_1$), ($x_2$, $y_2$), …, ($x_n$, $y_n$)} where $y_i$ is the label of the feature vector $x_i$. Let the hypothesis function be $h: X \to Y$. Let $\hat{y_i} = h(x_i)$ be the prediction of this hypothesis function for the feature vector $x_i$, whereas the true label is $y_i$. Then the loss function $L(y_i, \hat{y_i})$ is a function that measures the error between the predicted label and the true label. ...

January 1, 2025 · Victor

Main takeaway

The main takeaway from this exploration is that whenever you see a random process converting one distribution to another, SDEs should come to mind as a powerful mathematical framework. The three sampling methods we studied (Langevin dynamics, DDPM, SMLD) are all discrete approximations of continuous SDEs, differing mainly in their drift and diffusion terms. Understanding them through the SDE lens helps unify these approaches and provides a foundation for developing new sampling techniques.

January 1, 2025 · Victor

Make Book by Peter Levels

My takeaways from the book Record your ideas If you do not have idea then you need to live a better life - Be creative. Find problems in your life and solve them - then sell them as a product. Your idea list is very precious. Carry it everywhere. Note down ideas immediately. Ideas can come at any time. Do not miss them. Templates You should have templates for everything - Boiler plate code, launch procedures etc Automations Use automations exhaustively. Only hire humans under dire circumstances otherwise just use automations. Do not take external capital. Do not have co-founders - avoid groupthink drama. Most important thing is to not take any descions that may reduce your freedom or having fun. Avoid physical products. Focus on core functionality Build only the core functionality first. Ask for money Ask people to pay you for your product, do not have ads. Do not sell users data. ...

January 1, 2025 · Victor

Masked reconstruction

Idea Contrastive learning is one way to learn representations from unlabeled data. Masked reconstruction is another way. Formulation Let us formalize the masked reconstruction framework: Given: Input space $\mathcal{X}$ A data point $x \in \mathcal{X}$ A masking operator $\hat{x}$ that corrupts the input An encoder-decoder model $T_\theta(x)$ parameterized by $\theta$ The process works as follows: Apply masking operator: $\hat{x} = \text{mask}(x)$ Pass masked input through model: $\tilde{x} = T_\theta(\hat{x})$ Reconstruct original input: $\hat{x} \rightarrow \tilde{x} \approx x$ The objective is to minimize reconstruction loss: ...

January 1, 2025 · Victor

Maximum aposteriori estimate(MAP)

The Maximum A Posteriori (MAP) estimate is defined as: $$\theta^*_{MAP} = \arg\max_{\theta} p(\theta|V) = \arg\max_{\theta} p(V|\theta) p(\theta)$$ where - $\theta^*_{MAP}$ is the MAP estimate of the parameter $\theta$ - $p(\theta|V)$ is the posterior probability of the parameter $\theta$ given the observed data $V$ - $p(V|\theta)$ is the likelihood of the observed data $V$ given the parameter $\theta$ - $p(\theta)$ is the prior probability of the parameter $\theta$ Note that: Unlike MLE, MAP estimation incorporates prior knowledge about the parameter $\theta$ and observed data $V$ where as MLE only depends on the observed data $V$. MAP provides a balance between the likelihood of the data and the prior beliefs, leading to more robust estimates, especially when the data is limited. Conjugate prior A conjugate prior is a type of prior distribution $p(\theta)$ such that when multiplied with the likelihood function $p(V|\theta)$ the posterior distribution $p(\theta|V)$ that we get is in the same form as the prior $p(\theta)$. ...

January 1, 2025 · Victor

Minimizing KL Divergence is Equivalent to Maxmimizing Likelihood

For a typical ML problem, all we have are samples from the true distribution $P(x)$ ie $data = {(x_i)}_{i=1}^N$ where $x_i \in \mathbb{R}^d$ are data points. We do not know the distribution $P(x)$ explicitly. We try our best to estimate the true distribution $P(x)$ by $Q(x; \theta)$ where $\theta$ are the parameters of the model. We want to know how well our model $Q(x; \theta)$ is performing. We can do this by calculating the KL divergence between the true distribution $P(x)$ and the estimated distribution $Q(x; \theta)$. ...

January 1, 2025 · Victor

Miscellaneous Machine Learning Terms

Epoch One complete pass of the entire training dataset for training the model. Batch Size Risk is defined as $$L = \frac{1}{N} \sum_{i=1}^N l(y_i, \hat{y}_i)$$ Where $l(y_i, \hat{y}_i)$ is a general loss function that measures the discrepancy between the true value $y_i$ and the predicted value $\hat{y}_i$ for each sample. Instead of calculating the risk over the entire dataset, however calculating the risk over complete dataset is computationally expensive. Hence we calculate the risk over a small subset of the dataset, called a batch to perform back propogation. ...

January 1, 2025 · Victor

Mixture model clustering also known as soft clustering

Problem Setup Data: Let the dataset be $X = {x_1, x_2, …, x_N}$, where each data point $x_i \in \mathbb{R}^d$. The data points are unlabeled. Latent Variable: Let $z \in {1, …, m}$ be a latent variable representing the clusters, where $m$ is the total number of clusters. We can extend the dataset as $D = {(x_i, z_i)}_{i=1}^N$, where each data point $x_i$ is associated with its (unknown) cluster $z_i$. ...

January 1, 2025 · Victor

Multi-Armed Bandit Problem

Multi-Armed Bandit Problem The Multi-Armed Bandit problem is a fundamental concept in reinforcement learning, where an agent must repeatedly select from multiple options, known as “arms” (akin to slot machines), to maximize its cumulative reward. This scenario is simplified by the fact that the environment is state-less, meaning the outcome of an action is solely dependent on the action itself, without any influence from a changing state. Key characteristics of the Multi-Armed Bandit problem include: ...

January 1, 2025 · Victor