@@ -34,14 +34,16 @@ class PatchAdversarialLoss(_Loss):
3434 mustn't be passed to a final activation layer. That is taken care of internally within the loss.
3535
3636 Args:
37- reduction: {``"none"``, ``"mean"``, ``"sum"``} Specifies the reduction to apply to the output.
38- Defaults to ``"mean"``.
39- - ``"none"``: no reduction will be applied.
40- - ``"mean"``: the sum of the output will be divided by the number of elements in the output.
41- - ``"sum"``: the output will be summed.
37+ reduction: {``"none"``, ``"mean"``, ``"sum"``}
38+ Specifies the reduction to apply to the output. Defaults to ``"mean"``.
39+
40+ - ``"none"``: no reduction will be applied.
41+ - ``"mean"``: the sum of the output will be divided by the number of elements in the output.
42+ - ``"sum"``: the output will be summed.
43+
4244 criterion: which criterion (hinge, least_squares or bce) you want to use on the discriminators outputs.
43- Depending on the criterion, a different activation layer will be used. Make sure you don't run the outputs
44- through an activation layer prior to calling the loss.
45+ Depending on the criterion, a different activation layer will be used. Make sure you don't run the outputs
46+ through an activation layer prior to calling the loss.
4547 no_activation_leastsq: if True, the activation layer in the case of least-squares is removed.
4648 """
4749
@@ -112,14 +114,14 @@ def forward(
112114 """
113115
114116 Args:
115- input: output of Multi-Scale Patch Discriminator or Patch Discriminator; being a list of
116- tensors or a tensor; they shouldn't have gone through an activation layer.
117+ input: output of Multi-Scale Patch Discriminator or Patch Discriminator; being a list of tensors
118+ or a tensor; they shouldn't have gone through an activation layer.
117119 target_is_real: whereas the input corresponds to discriminator output for real or fake images
118120 for_discriminator: whereas this is being calculated for discriminator or generator loss. In the last
119- case, target_is_real is set to True, as the generator wants the input to be dimmed as real.
121+ case, target_is_real is set to True, as the generator wants the input to be dimmed as real.
120122 Returns: if reduction is None, returns a list with the loss tensors of each discriminator if multi-scale
121- discriminator is active, or the loss tensor if there is just one discriminator. Otherwise, it returns the
122- summed or mean loss over the tensor and discriminator/s.
123+ discriminator is active, or the loss tensor if there is just one discriminator. Otherwise, it returns the
124+ summed or mean loss over the tensor and discriminator/s.
123125
124126 """
125127
0 commit comments