zcemycl / Matlab-GAN

MATLAB implementations of Generative Adversarial Networks -- from GAN to Pixel2Pixel, CycleGAN
MIT License
189 stars 86 forks source link

batching indexing missing is some gans #3

Closed tjr1 closed 4 years ago

tjr1 commented 4 years ago

First, thank you. This is an impressive collection of work you are sharing.

Some of the GANS seem to be missing batch indexing.

Should they have

idx = (i-1)*settings.batch_size+1:i*settings.batch_size;
ABatch=gpdl(trainAshuffle(:,:,:,idx),'SSCB');
BBatch=gpdl(trainBshuffle(:,:,:,idx),'SSCB');

rather than just

ABatch=gpdl(trainAshuffle(:,:,:,i),'SSCB');
BBatch=gpdl(trainBshuffle(:,:,:,i),'SSCB');

?

zcemycl commented 4 years ago

I did this because my gpu RAM (2-4 gb) is running out of memory, if you have a good enough gpu, then you should have a larger batch.