FlowMatchingScheduler中shift的作用
Shift 调节工具
$$t'=\frac{shift\cdot t}{1+(shift-1)\cdot t}$$
$$\mu=\frac{y_2-y_1}{x_2-x_1}\cdot n_{tokens}+\left(y_1-\frac{y_2-y_1}{x_2-x_1}\cdot x_1\right),\quad t'=\frac{e^\mu}{e^\mu+\left(\frac{1}{t}-1\right)^\gamma}$$
$$x_1=\mathrm{flux\_base\_token},\quad x_2=\mathrm{flux\_max\_token}$$
$$y_1=\mathrm{flux\_base\_shift}\cdot\mathrm{flux\_shift\_factor},\quad y_2=\mathrm{flux\_max\_shift}\cdot\mathrm{flux\_shift\_factor}$$
训练时间步
1000
sigma 点数
31
模型 timestep 数
30
有效 shift
3.000000
Flux gamma
1.000000
没有调整
使用 shift 调整之后
没有调整的数据
使用 shift 调整之后的数据
逐步对照
| index | sigma | shift sigma | timestep | shift timestep |
|---|