-
Notifications
You must be signed in to change notification settings - Fork 6k
[Type hint] PNDM schedulers #335
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
[Type hint] PNDM schedulers #335
Conversation
The documentation is not available anymore as the PR was closed or merged. |
num_train_timesteps: int = 1000, | ||
beta_start: float = 0.0001, | ||
beta_end: float = 0.02, | ||
beta_schedule: Optional[str] = "linear", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beta_schedule: Optional[str] = "linear", | |
beta_schedule: str = "linear", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beta_schedule
has to be string I think :-)
beta_start: float = 0.0001, | ||
beta_end: float = 0.02, | ||
beta_schedule: Optional[str] = "linear", | ||
tensor_format: Optional[str] = "pt", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tensor_format: Optional[str] = "pt", | |
tensor_format: str = "pt", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think the tensor_format
cannot be None
@@ -97,7 +97,7 @@ def __init__( | |||
self.tensor_format = tensor_format | |||
self.set_format(tensor_format=tensor_format) | |||
|
|||
def set_timesteps(self, num_inference_steps, offset=0): | |||
def set_timesteps(self, num_inference_steps: int, offset=0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def set_timesteps(self, num_inference_steps: int, offset=0): | |
def set_timesteps(self, num_inference_steps: int, offset: int = 0) -> torch.FloatTensor: |
original_samples: Union[torch.FloatTensor, np.ndarray], | ||
noise: Union[torch.FloatTensor, np.ndarray], | ||
timesteps: Union[torch.IntTensor, np.ndarray], | ||
): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
): | |
) -> torch.Tensor: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the PR! Looks good - left a couple of suggestions :-)
@patrickvonplaten made the necessary changes :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool! Thanks
* [Type hint] PNDM Schedulers * ran make style * updated timesteps type hint * apply suggestions from code review * ran make style * removed unused import
* [Type hint] PNDM Schedulers * ran make style * updated timesteps type hint * apply suggestions from code review * ran make style * removed unused import
* init schedulers docs * add some docstrings, fix sidebar formatting * add docstrings * [Type hint] PNDM schedulers (#335) * [Type hint] PNDM Schedulers * ran make style * updated timesteps type hint * apply suggestions from code review * ran make style * removed unused import * [Type hint] scheduling ddim (#343) * [Type hint] scheduling ddim * apply suggestions from code review apply suggestions to also return the return type Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> * make style * update class docstrings * add docstrings * missed merge edit * add general docs page * modify headings for right sidebar Co-authored-by: Partho <parthodas6176@gmail.com> Co-authored-by: Santiago Víquez <santi.viquez@gmail.com> Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
* [Type hint] PNDM Schedulers * ran make style * updated timesteps type hint * apply suggestions from code review * ran make style * removed unused import
* init schedulers docs * add some docstrings, fix sidebar formatting * add docstrings * [Type hint] PNDM schedulers (huggingface#335) * [Type hint] PNDM Schedulers * ran make style * updated timesteps type hint * apply suggestions from code review * ran make style * removed unused import * [Type hint] scheduling ddim (huggingface#343) * [Type hint] scheduling ddim * apply suggestions from code review apply suggestions to also return the return type Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com> * make style * update class docstrings * add docstrings * missed merge edit * add general docs page * modify headings for right sidebar Co-authored-by: Partho <parthodas6176@gmail.com> Co-authored-by: Santiago Víquez <santi.viquez@gmail.com> Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
Based on 24, 25, and 26 of issue #287
@anton-l could you check it?
Thanks :)