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

in fucntion training_step, why x_start = (x_start) * 2 - 1 #26

Open
cqlouis opened this issue Oct 12, 2023 · 4 comments
Open

in fucntion training_step, why x_start = (x_start) * 2 - 1 #26

cqlouis opened this issue Oct 12, 2023 · 4 comments

Comments

@cqlouis
Copy link

cqlouis commented Oct 12, 2023

def training_step(self, batch):
        image, label = self.get_input(batch)
        x_start = label

        x_start = (x_start) * 2 - 1

why x_start = (x_start)*2 -1 ?

Can I use x_start directly, instead of two times and minus1?

@920232796
Copy link
Contributor

Yes, it's ok. This operator makes x_start in [-1, 1] range, bacause the diffusion model's input is usually in [-1, 1].

@cqlouis
Copy link
Author

cqlouis commented Oct 12, 2023

Yes, it's ok. This operator makes x_start in [-1, 1] range, bacause the diffusion model's input is usually in [-1, 1].

Thanks for your quick reply.

Another question:
I was wondering if there should be some modification in the rest of coding on the condition of making x_start in [-1, 1] or not.

In Chinese: 把x_start 转化为[-1,1]和不转换,直接使用其值在[0,1],这两种情况,在代码上,是不是有什么地方需要做对应的修改?

@920232796
Copy link
Contributor

No. You can train the model directly, and this operator only has a little change on the validation results.

@cqlouis
Copy link
Author

cqlouis commented Oct 12, 2023

No. You can train the model directly, and this operator only has a little change on the validation results.

Thanks!

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