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

Why is the flow-DPM Solver so much worse than Euler's method in my flow matching model. FID become very large when use it #91

Open
lllzzz3 opened this issue Dec 14, 2024 · 3 comments
Labels
Answered Answered the question

Comments

@lllzzz3
Copy link

lllzzz3 commented Dec 14, 2024

@torch.no_grad()
def sample(self, shape):
self.eval()
zt = torch.randn(shape).cuda() ## init the noise

    noise_schedule = NoiseScheduleFlow(schedule='discrete_flow')
    model_fn_continuous = model_wrapper(
                    self.model,
                    noise_schedule,
                    model_type="flow",
                    model_kwargs={},
                    guidance_type="uncond" ,
                    condition= None,
                    classifier_kwargs={},
                    interval_guidance = [0, 1.0],
                )
    dpm_solver = DPM_Solver(
                    model_fn_continuous,
                    noise_schedule,
                    algorithm_type="dpmsolver++",
                )
    zt = dpm_solver.sample(
                    zt, steps=20, order=2,
                    skip_type="time_uniform_flow",
                    method="multistep", 
                    lower_order_final=False,
                    denoise_to_zero=True,
                    solver_type="dpmsolver", 
                    atol=0.0078, rtol=0.05, flow_shift=3.0
        )
    return zt 
@lawrence-cj
Copy link
Collaborator

What's your flow matching model's schedule? Could you provide more info about it?

@lllzzz3
Copy link
Author

lllzzz3 commented Dec 17, 2024

My flow matching model's schedule is 'discrete_flow'. I've fixed this issue, but I've found a new problem, I've found that order=2 works really well most of the time in the case of multi-step solving, but it gets worse with order=3

@lawrence-cj
Copy link
Collaborator

Got it. Actually, I haven't tested about order=3 cases. We only use order=2 in our experiments. I'll look into it later, also if you have any insight on it, let me know.

@lawrence-cj lawrence-cj added the Answered Answered the question label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Answered Answered the question
Projects
None yet
Development

No branches or pull requests

2 participants