File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
Expand file tree Collapse file tree 2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -137,8 +137,7 @@ def sample_c(size):
137137 Q_c_given_x = Q (G_sample )
138138
139139 crossent_loss = torch .mean (- torch .sum (c * torch .log (Q_c_given_x + 1e-8 ), dim = 1 ))
140- ent_loss = torch .mean (- torch .sum (c * torch .log (c + 1e-8 ), dim = 1 ))
141- mi_loss = crossent_loss + ent_loss
140+ mi_loss = crossent_loss
142141
143142 mi_loss .backward ()
144143 Q_solver .step ()
Original file line number Diff line number Diff line change @@ -101,8 +101,7 @@ def plot(samples):
101101G_loss = - tf .reduce_mean (tf .log (D_fake + 1e-8 ))
102102
103103cross_ent = tf .reduce_mean (- tf .reduce_sum (tf .log (Q_c_given_x + 1e-8 ) * c , 1 ))
104- ent = tf .reduce_mean (- tf .reduce_sum (tf .log (c + 1e-8 ) * c , 1 ))
105- Q_loss = cross_ent + ent
104+ Q_loss = cross_ent
106105
107106D_solver = tf .train .AdamOptimizer ().minimize (D_loss , var_list = theta_D )
108107G_solver = tf .train .AdamOptimizer ().minimize (G_loss , var_list = theta_G )
You can’t perform that action at this time.
0 commit comments