junhsss / consistency-models

A Toolkit for OpenAI's Consistency Models.
https://arxiv.org/abs/2303.01469
MIT License
195 stars 11 forks source link

Data std #8

Closed YIN95 closed 1 year ago

YIN95 commented 1 year ago

Hi,

Thanks for sharing the code. I have a question about the data std, with transforms.Normalize([0.5], [0.5]), maybe the data std is 1 instead of 0.5?

junhsss commented 1 year ago

Hi @YIN95! You are absolutely right.

Assuming 0.5 is the true standard deviation of cifar10, the value of data_std should be 1. Thanks for pointing that out!

YIN95 commented 1 year ago

Hi @YIN95! You are absolutely right.

Assuming 0.5 is the true standard deviation of cifar10, the value of data_std should be 1. Thanks for pointing that out!

However, in openai's official code, they also normalize the images to [-1, 1], but the sigma_data=0.5.

image image

junhsss commented 1 year ago

Ah I see. data_std is the standard deviation of cifar10 AFTER [-1, 1] normalization. The standard deviation of cifar10 before normalization is about 0.25, hence 0.5 makes sense.