Diff-UNet
Diff-UNet copied to clipboard
in fucntion training_step, why x_start = (x_start) * 2 - 1
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?
Yes, it's ok. This operator makes x_start in [-1, 1] range, bacause the diffusion model's input is usually in [-1, 1].
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],这两种情况,在代码上,是不是有什么地方需要做对应的修改?
No. You can train the model directly, and this operator only has a little change on the validation results.
No. You can train the model directly, and this operator only has a little change on the validation results.
Thanks!