junyanz / CycleGAN

Software that can generate photos from paintings, turn horses into zebras, perform style transfer, and more.
Other
12.23k stars 1.93k forks source link

a question about loading data #99

Open woshinierbaba opened 5 years ago

woshinierbaba commented 5 years ago

hello,I wanna to know when you loading the data, why you operate them with x/127.5-1 other than x/255?

junyanz commented 5 years ago

We want to make sure that the data is [-1, 1] (with mean=0). Also, the generator's last layer is TanH, whose range is also [-1, 1]. You can also do x/255 but you need to use Sigmoid ([0, 1]) for the generator's last layer.