Skip to content

Commit

Permalink
Update unet_gan_fitS0.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Ksuriuri authored Sep 23, 2022
1 parent 806116e commit c8ba8c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unet_gan_fitS0/unet_gan_fitS0.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def train():
loss_g = loss_g_rec + loss_g_fake

# outputs_rec_syn, ivim_pre_syn = g(syn_x)
loss_G = loss_rec + 1 * loss_p # + 1e-4 * loss_g
loss_G = loss_rec + 1 * loss_p + 1e-4 * loss_g

optimizer_g.zero_grad() # 梯度置零,因为反向传播过程中梯度会累加上一次循环的梯度
loss_G.backward() # retain_graph=True
Expand Down

0 comments on commit c8ba8c9

Please sign in to comment.