I add theses lines that bound TrianedVarience from zero:
stateT=stateG;
idx = stateT.Parameter == "TrainedVariance";
boundAwayFromZero = @(X) max(X, eps('single'));
stateT(idx,:) = dlupdate(boundAwayFromZero, stateT(idx,:));
netG.State = stateT;
But then the generator can no longer generate anything out, probabaly because the TrianedVarience keeps drop to zero even if i prevent it drop to negative values...
By "no longer generate anything out", I mean after several epoches, the ouput of generator "I" when I image it, it is a blank...