hi guys, i was wondering how can implement adversarial training in my mlp when i have a distributional lambda layer t hat model a gaussian as last layer
tfp.layers.DistributionLambda(normal_sp, name='normal_sp')( params_mc )
with normal_sp defined as
def normal_sp(params):
#return tfd.Normal(loc=params[:,0:1], scale=1e-5 + params[:,1:2])
return tfd.Normal(loc= params[:,0:1], scale=1e-3 +tf.math.softplus(0.005* params[:,1:2]) )
and my loss fucntion is simply
def NLL(y, distr):
return -distr.log_prob(y)