Each MeanFlow training sample needs two times, an earlier time and a later time , both in . The paper draws two values independently from a base distribution, assigns the larger to and the smaller to , and then lets only a set share of the samples keep . The rest have , which makes them ordinary Flow Matching samples.
So that the function is deterministic, the random draws are passed in.
sample_r_t(n1, n2, keep, mu=-0.4, sigma=1.0, ratio=0.25, kind="lognorm")
n1, n2, keep: arrays of shape (B,).kind="lognorm" (logit-normal): n1 and n2 are standard normal draws. Each is turned into a time by with .kind="uniform": n1 and n2 are already uniform draws in and are used as they are (mu and sigma are ignored).keep holds uniform draws in . Sample keeps its if keep[i] < ratio. Otherwise its is set equal to its .(r, t), two arrays of shape (B,).ValueError for any other kind, or if ratio is outside .