← all notes

Flow Matching

concept

The core idea:

For a piece of random Gaussian noise
π‘₯
0
and an input
π‘₯
1
,

On the line joining these two points, we can have
π‘₯
𝜏
where,

π‘₯
𝜏
=
(
1
βˆ’
𝜏
)
π‘₯
0
+
𝜏
π‘₯
1

Train a network that can predict
πœ•
π‘₯
𝜏
πœ•
𝜏
, which is nothing but:

(
πœ•
π‘₯
𝜏
)
πœ•
𝜏
)
=
βˆ’
π‘₯
0
+
π‘₯
1
β‡’
πœ•
π‘₯
𝜏
πœ•
𝜏
=
π‘₯
1
βˆ’
π‘₯
0

The loss function looks like:

𝐿
(
πœƒ
)
=
β€–
𝑓
πœƒ
(
π‘₯
𝜏
,
𝜏
)
βˆ’
(
π‘₯
1
βˆ’
π‘₯
0
)
β€–
2

What does this network allow us to do? Now, we can simply supply an image of pure Gaussian noise and follow the network’s predicted velocity for a certain distance over multiple steps. This is Euler integration.

π‘₯
𝜏
+
𝑑
=
π‘₯
𝜏
+
𝑑
𝑓
πœƒ
(
π‘₯
𝜏
,
𝜏
)