799aed2e658f677225d4f796e1251f26b52399aa,examples/next-frame.py,NextFrameGAN,forward_loss,#NextFrameGAN#,306
Before Change
self.xs = []
for i in range(self.frames-self.per_sample_frames+1):
self.xs += [torch.cat(current_inputs[i:i+self.per_sample_frames], dim=1)]
d_loss, g_loss = self.forward_pass(current_inputs, self.xs, cs, gs, gcs, rgs, rcs, loss)
if self.config.image_discriminator:
self.ix = self.last_x
After Change
self.zs, self.gzs = zs, gzs
d_loss = torch.tensor([0.0]).cuda()
g_loss = torch.tensor([0.0]).cuda()
if self.config.vae:
g_loss += vae_loss
self.add_metric("vae", vae_loss)
if self.config.mse:
mse = nn.MSELoss()
mse_loss = mse(self.mse_g, self.last_x)
d_loss += mse_loss
g_loss += mse_loss
self.add_metric("mse", mse_loss)
if self.config.regularize_c:
all_cs = cs + gcs
c_mean = sum([c.mean() for c in all_cs])/len(all_cs)
self.add_metric("c_mean", c_mean)
g_loss += c_mean
if self.config.discriminator:
if self.config.discriminator3d:
self.x = torch.cat([x[:, :, None, :, :] for x in current_inputs], dim=2)
else:
self.x = torch.cat(current_inputs[:self.per_sample_frames], dim=1)
self.xs = []
for i in range(self.frames-self.per_sample_frames+1):
self.xs += [torch.cat(current_inputs[i:i+self.per_sample_frames], dim=1)]
_d_loss, _g_loss = self.forward_pass(current_inputs, self.xs, cs, gs, gcs, rgs, rcs, loss)
g_loss += _g_loss
d_loss += _d_loss
if self.config.image_discriminator:
self.ix = self.last_x
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
Instances
Project Name: HyperGAN/HyperGAN
Commit Name: 799aed2e658f677225d4f796e1251f26b52399aa
Time: 2020-12-27
Author: martyn@255bits.com
File Name: examples/next-frame.py
Class Name: NextFrameGAN
Method Name: forward_loss
Project Name: keon/seq2seq
Commit Name: af79a5c7760057a7dec1b68b97639cc69f40c3ea
Time: 2017-12-03
Author: kwk236@gmail.com
File Name: train.py
Class Name:
Method Name: evaluate
Project Name: SenticNet/conv-emotion
Commit Name: 1606a75405ca47d569acdd2a64a052abcf3f2bd1
Time: 2019-12-22
Author: deepanwayedu@gmail.com
File Name: DialogueGCN/model.py
Class Name:
Method Name: attentive_node_features
Project Name: leftthomas/SRGAN
Commit Name: eab5e7909d647e363002b529e9d39911f4a2b028
Time: 2017-12-01
Author: leftthomas@qq.com
File Name: train2.py
Class Name:
Method Name: train