Discriminative vs Generative Models
To generate a sample from a particular class, we can use inverse mapping techniques to transform a randomly chosen value from the output space back to the sample space of the class.
Another useful application for the generative model is anomaly detection:
Anomaly detection is one of the many applications where generative models excel. In this context, a generative model could be trained to learn the normal behavior of a system, represented by some underlying data distribution. Once the model is trained, it can then be used to identify anomalies or outliers, which are data points that significantly deviate from the learned distribution.
For instance, they can identify unusual patterns in network traffic to flag potential cybersecurity threats. Any network activity that significantly deviates from this learned Gaussian distribution could be flagged as a potential cybersecurity threat. See the following for a visual demonstration:
The green histogram represents the normal data distribution, while the red points are anomalies that deviate significantly from this distribution. In a real-world application, such points could be flagged for further investigation.