feature(wrh): add edm initial implementation#1
Open
ruiheng123 wants to merge 16 commits intoopendilab:mainfrom
Open
feature(wrh): add edm initial implementation#1ruiheng123 wants to merge 16 commits intoopendilab:mainfrom
ruiheng123 wants to merge 16 commits intoopendilab:mainfrom
Conversation
ruiheng123
commented
Aug 20, 2024
- Paper reference: https://arxiv.org/abs/2206.00364
- Code reference: https://github.com/NVlabs/edm
PaParaZz1
requested changes
Aug 21, 2024
grl/generative_models/edm_diffusion_model/edm_diffusion_model.py
Outdated
Show resolved
Hide resolved
| def __init__(self, config: Optional[EasyDict]=None) -> None: | ||
|
|
||
| super().__init__() | ||
| self.config= config |
| return loss | ||
|
|
||
|
|
||
| def _get_sigma_steps_t_steps(self, num_steps=18, epsilon_s=1e-3, rho=7): |
Member
There was a problem hiding this comment.
if this method is called with the same argument during training, you should just call it once
grl/generative_models/edm_diffusion_model/edm_diffusion_model.py
Outdated
Show resolved
Hide resolved
grl/generative_models/edm_diffusion_model/edm_preconditioner.py
Outdated
Show resolved
Hide resolved
| c_in = 1 / (sigma ** 2 + 1).sqrt() | ||
| c_noise = self.M - 1 - self.round_sigma(sigma, return_index=True).to(torch.float32) | ||
| elif self.precondition_type == "EDM": | ||
| c_skip = self.sigma_data ** 2 / (sigma ** 2 + self.sigma_data ** 2) |
Member
There was a problem hiding this comment.
for some constant variable, such as self.sigma_data ** 2, we can pre-compute them to save computation.
grl/generative_models/edm_diffusion_model/edm_diffusion_model.py
Outdated
Show resolved
Hide resolved
…into dev-edm merge it the commit.
49f5fc0 to
9fa1b41
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.