Could you help this part of the code
errD_real.backward(one)
there is no loss function. the D model is just returning the mean of the mini batch input. how the network is calculating the cost and computing the gradient?

  
      github.com
  
  
    martinarjovsky/WassersteinGAN/blob/master/main.py 15
from __future__ import print_function
import argparse
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torchvision.datasets as dset
import torchvision.transforms as transforms
import torchvision.utils as vutils
from torch.autograd import Variable
import os

import models.dcgan as dcgan
import models.mlp as mlp

parser = argparse.ArgumentParser()
parser.add_argument('--dataset', required=True, help='cifar10 | lsun | imagenet | folder | lfw ')


  This file has been truncated. show original