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

refactor: rename noise => predicted_noise #203

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

brycedrennan
Copy link
Contributor

noise => predicted_noise
denoised_x => renoised_x (denoised seems inaccurate since it does have noise added)

@brycedrennan brycedrennan force-pushed the bd/scheduler-naming branch 2 times, most recently from 366977c to bb380a7 Compare January 20, 2024 18:31
@limiteinductive
Copy link
Contributor

noise => predicted_noise denoised_x => renoised_x (denoised seems inaccurate since it does have noise added)

A propos renoised_x, I get that since it is not fully denoised but only slightly denoised, denoised_x is a bit ambiguous; maybe intermediary_denoised_x or partially_denoised_x is more accurate, but they feel a bit too much for me.

For me, renoising suggests that we're stationary in the level of noise

@limiteinductive
Copy link
Contributor

noise => predicted_noise denoised_x => renoised_x (denoised seems inaccurate since it does have noise added)

and noise => predicted_noise is ok for me

@brycedrennan
Copy link
Contributor Author

brycedrennan commented Jan 20, 2024

Yeah that makes sense. I think just calling it next_x would be less misleading. Of all the ideas so far though, I do like slightly_denoised_x best- it conveys exactly what it is, even if its a long name. It is at least not used outside the function.

I was suspicious that labeling it "denoised" contributed to the bug of it being returned in the final step. I'm also suspicious that a similar bug exists in the other schedulers but I haven't investigated enough yet.

These changes were in the context of a not-finished pull request where I make the following change in ddim (and was looking to see if similar changes applied in the other schedulers):

        if step == self.num_inference_steps - 1:
            noise_factor = 0

to

        if step == self.num_inference_steps - 1:
            return predicted_x

@catwell
Copy link
Member

catwell commented Jan 22, 2024

As far as I understand it the additional noise term is not really a "bug", at least not in refiners, it's a discrepancy with the original implementation of SD (CompVis) which we used as a reference. See the documentation of the set_alpha_to_one option in Diffusers, for instance. It did not come from the naming.

Regarding other schedulers, the ability to use a 1st order update for the last step in DPM(++) solver that I added last week is somehow similar. It will remove the same kind of noise which is visible especially if you use SDXL with few timesteps. For now we decided against making it the default.

@brycedrennan brycedrennan force-pushed the bd/scheduler-naming branch 4 times, most recently from d913cba to d52cfc8 Compare January 22, 2024 15:42
@brycedrennan brycedrennan changed the title refactor: rename some variables to be more precise refactor: rename noise => predicted_noise Jan 22, 2024
@brycedrennan
Copy link
Contributor Author

I have reduced the scope of this pull request to just noise => predicted_noise

@brycedrennan
Copy link
Contributor Author

@catwell thanks for the context - that makes sense

@brycedrennan
Copy link
Contributor Author

We've discussed a few changes here and I'm happy to do all or none of them. Let me know what is desired to get this closed out.

@deltheil
Copy link
Member

We've discussed a few changes here and I'm happy to do all or none of them. Let me know what is desired to get this closed out.

How about this:

  1. Let's keep the noise => predicted_noise renaming (makes things more readable)
  2. Re: schedulers/euler.py => let's keep the implementation as-is, except the noise => predicted_noise and alt_noise => noise renamings. Rationale: we're going to revamp it (completely) at some point

@brycedrennan does that work for you? Many thanks!

and in euler, `alt_noise` can now be simply `noise`
@brycedrennan
Copy link
Contributor Author

sounds good - done

Copy link
Member

@deltheil deltheil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@deltheil deltheil added the run-ci Run CI label Jan 24, 2024
@deltheil deltheil merged commit 12a5439 into finegrain-ai:main Jan 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-ci Run CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants