liveBook · Manning

Contrastive learning

Contrastive learning is a representation-learning technique that trains a model to bring representations of related examples closer and separate representations of unrelated examples.

How 2 Manning books explain it

Build a Text-to-Image Generator (from Scratch)

Contrastive learning is a representation-learning technique that brings related examples closer and separates nonmatching examples in an embedding space.

How it is used
Uses shared embeddings to measure image–text similarity and support cross-modal retrieval.
How deep it goes
Explains encoders, batch similarities, and bidirectional losses, then stops short of deriving the loss equations.
Examples
Demonstrates Flickr 8k image–caption pairs, a beach-dog prompt, and batch diagonal versus off-diagonal similarities.
What you can do after
Apply it via CLIP to select images matching text descriptions and evaluate image–text compatibility.

Read how Build a Text-to-Image Generator (from Scratch) explains contrastive learning →

Outlier Detection in Python

A representation-learning technique that brings embeddings of similar items closer together and separates embeddings of dissimilar items.

How it is used
Uses learned embedding similarity as a self-supervised approach to tabular outlier detection.
How deep it goes
Defines the embedding objective and sketches ICL, but defers detailed implementation and training mechanics.
Examples
Uses altered images, tabular feature subsets, and KDD Cup records scored through DeepOD.
What you can do after
Apply it via DeepOD’s ICL estimator to fit tabular data and compute outlier scores.

Read how Outlier Detection in Python explains contrastive learning →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.