Skip to content

Commit

Permalink
Update 7d-OOD-detection-distance.md
Browse files Browse the repository at this point in the history
  • Loading branch information
qualiaMachine authored Dec 19, 2024
1 parent f8a3bfc commit 6064725
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion episodes/7d-OOD-detection-distance.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ $$
D_M(x) = \sqrt{(x - \mu)^T \Sigma^{-1} (x - \mu)}
$$
where:

- x: The input data point.
- \(mu\): The mean vector of the distribution.
- Sigma: The covariance matrix of the distribution. The inverse of the covariance matrix is used to "whiten" the feature space, ensuring that features with larger variances do not dominate the distance computation. This adjustment also accounts for correlations between features, transforming the data into a space where all features are uncorrelated and standardized.
This approach is robust for high-dimensional data as it accounts for correlations between features.

```python
import numpy as np
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -403,4 +405,4 @@ This results in a *feature space with semantic clusters*, where data points with

While contrastive learning provides an exciting opportunity to improve OOD detection, it represents a shift from the traditional threshold- or distance-based approaches we have discussed so far. By learning a feature space that is inherently more generalizable and robust, contrastive learning offers a promising solution to the challenges posed by overlapping Mahalanobis distance distributions.

If you're interested, we can explore specific contrastive learning methods like **SimCLR** or **MoCo** in future sessions, diving into how their objectives help create robust feature spaces!
If you're interested, we can explore specific contrastive learning methods like **SimCLR** or **MoCo** in future sessions, diving into how their objectives help create robust feature spaces!

0 comments on commit 6064725

Please sign in to comment.