Generate the time schedule: linspace(0, 1, num_steps+1) with t_shift applied.
(&self)
| 23 | |
| 24 | /// Generate the time schedule: linspace(0, 1, num_steps+1) with t_shift applied. |
| 25 | pub fn time_schedule(&self) -> Vec<f32> { |
| 26 | let mut times = Vec::with_capacity(self.num_steps + 1); |
| 27 | for i in 0..=self.num_steps { |
| 28 | let t = i as f32 / self.num_steps as f32; |
| 29 | let t_shifted = if (self.t_shift - 1.0).abs() > 1e-6 { |
| 30 | self.t_shift * t / (1.0 + (self.t_shift - 1.0) * t) |
| 31 | } else { |
| 32 | t |
| 33 | }; |
| 34 | times.push(t_shifted); |
| 35 | } |
| 36 | times |
| 37 | } |
| 38 | |
| 39 | /// Perform one flow matching Euler step. |
| 40 | /// Returns updated x for the next timestep. |