> For the complete documentation index, see [llms.txt](https://hypergan.gitbook.io/hypergan/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hypergan.gitbook.io/hypergan/components/loss/wasserstein-loss.md).

# Wasserstein Loss

* Source: [/losses/wasserstein\_loss.py](https://github.com/HyperGAN/HyperGAN/tree/pytorch/hypergan/losses/wasserstein_loss.py)

```python
d_loss = -d_real + d_fake
g_loss = -d_fake
```

## examples

* Configurations: [/losses/wasserstein\_loss/](https://github.com/HyperGAN/HyperGAN/tree/pytorch/hypergan/configurations/components/losses/wasserstein_loss/)

```javascript
{
  "class": "function:hypergan.losses.wasserstein_loss.WassersteinLoss",
  "kl": true
}
```

```javascript
{
  "class": "function:hypergan.losses.wasserstein_loss.WassersteinLoss",
}
```

## options

| attribute | description                                            | type               |
| --------- | ------------------------------------------------------ | ------------------ |
| kl        | <https://arxiv.org/abs/1910.09779> Defaults to `false` | boolean (optional) |
