b63bd3184d5708a11c522e6e2a11ad79834422d5,pixyz/losses/adversarial_loss.py,AdversarialLoss,__init__,#AdversarialLoss#Any#Any#Any#Any#Any#Any#,8
Before Change
self.d_optimizer = optimizer(params, **optimizer_params)
// TODO: fix this decision rule
if p.distribution_name == "Data distribution":
self._p_data_dist = True
else:
self._p_data_dist = False
if q.distribution_name == "Data distribution":
self._q_data_dist = True
else:
self._q_data_dist = False
After Change
class AdversarialLoss(Loss):
def __init__(self, p, q, discriminator, input_var=None,
optimizer=optim.Adam, optimizer_params={}):
if p.var != q.var:
raise ValueError("The two distribution variables must be the same.")
if len(p.input_var) > 0:
self.input_dist = p
elif len(q.input_var) > 0:
self.input_dist = q
else:
raise NotImplementedError
super().__init__(p, q, input_var=input_var)
self.loss_optimizer = optimizer
self.loss_optimizer_params = optimizer_params
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 12
Instances
Project Name: masa-su/pixyz
Commit Name: b63bd3184d5708a11c522e6e2a11ad79834422d5
Time: 2019-03-14
Author: masa@weblab.t.u-tokyo.ac.jp
File Name: pixyz/losses/adversarial_loss.py
Class Name: AdversarialLoss
Method Name: __init__
Project Name: arraiy/torchgeometry
Commit Name: e06eee5deec11dc03d6c4975eb9a57f2bc6edd30
Time: 2019-05-28
Author: jiangwei1993@gmail.com
File Name: kornia/utils/image.py
Class Name:
Method Name: image_to_tensor
Project Name: masa-su/pixyz
Commit Name: 161ae41bebc73c146627169f761e3c4ddf83e5d4
Time: 2020-10-26
Author: kaneko@weblab.t.u-tokyo.ac.jp
File Name: pixyz/losses/losses.py
Class Name: Divergence
Method Name: __init__