val-iisc / deligan

This project is an implementation of the Generative Adversarial Network proposed in our CVPR 2017 paper - DeLiGAN : Generative Adversarial Networks for Diverse and Limited Data. DeLiGAN is a simple but effective modification of the GAN framework and aims to improve performance on datasets which are diverse yet small in size.
MIT License
110 stars 28 forks source link

generating same sample #6

Closed SchafferZhang closed 6 years ago

SchafferZhang commented 6 years ago

Hi, when I utilize the trained model to generate the samples, which the corresponding code is

`#Uncomment this block for generating GAN samples from given model ''' f = np.load(args.results_dir + '/disc_params1180.npz') paramvalues = [f['arr%d' % i] for i in range(len(f.files))] for i,p in enumerate(disc_params): p.set_value(param_values[i]) print("disc_params fed") f = np.load(args.results_dir + '/gen_params1180.npz') paramvalues = [f['arr%d' % i] for i in range(len(f.files))] for i,p in enumerate(gen_params): p.set_value(param_values[i]) print("gen_params fed") samples=[] for i in range(50): sample_x = samplefun() samples.append(sample_x) samples = np.concatenate(samples,0) print(samples)

sys.exit()

np.save(args.results_dir + '/samples50k.npy', samples) print("samples saved") sys.exit() '''`

but for each iteration i, the image in the sample_x are diverse, but every sample_x is the same. what' wrong with it?

swami1995 commented 6 years ago

Hi, Yeah, we faced that problem too sometimes with very small datasets, but some workarounds helped us resolve those issues.. for example decreasing the dimensionality of z, increasing the number of gaussians components and increasing the weight of the regularisation term.. But I agree, even after these workarounds sometimes it still was unstable and difficult to tune. Perhaps tuning these parameters might help?