Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Influence of sigma_t in loss_t #10

Open
cyanbx opened this issue Apr 1, 2024 · 1 comment
Open

Influence of sigma_t in loss_t #10

cyanbx opened this issue Apr 1, 2024 · 1 comment

Comments

@cyanbx
Copy link

cyanbx commented Apr 1, 2024

Hi, thanks for your great work. I notice that you add a small gaussian noise when sampling x_t in CFM:

mu_t = t_unsqueeze * x1 + (1 - t_unsqueeze) * x0  # conditional Gaussian mean
sigma_t = self.sigma_min
x = mu_t + sigma_t * torch.randn_like(x1)  # sample p_t(x|x_0, x_1)

This matches the description in your paper. However, I see most other works of rectified flow do not use this sigma_t and they simply use the mean value mu_t as the sampled x_t. I wonder if you have explored on how big influence this sigma_t has on the model performance, and what is the appropriate range of values for sigma_t ? Thanks for your help in advance.

@cantabile-kwok
Copy link
Member

cantabile-kwok commented Apr 1, 2024

Thank you for the question, and I think this is a really good one. Honestly I don't have a solid answer to this, because in the conditional flow matching paper (https://arxiv.org/abs/2302.00482v1) they have the small $\sigma$, but in rectified flow (https://arxiv.org/abs/2209.03003) this $\sigma$ does not exist. From a mathematical perspective, the boundary condition of the conditional probability field $p(x_t|x_1,x_0)$ requires the $\sigma$ to be small, and it does not seem to have a great theoretical impact if we just set it to 0.

Personally, I have not done investigations on this tricky $\sigma$, but some time ago someone told me setting $\sigma$ to a smaller value than the current one "seemed to lead to worse performance". If this observation is true, then I guess a non-zero $\sigma$ helps to "smooth" the flow matching trajectory so that the model does not only learn on the line between $x_1$ and $x_0$, but also the regions nearby. This is just an intuition though, and more empirical evidence is needed to verify this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants