> 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/logistic-loss.md).

# Logistic Loss

* Adapted from <http://stylegan.xyz/paper>
* Source: [/losses/logistic\_loss.py](https://github.com/HyperGAN/HyperGAN/tree/pytorch/hypergan/losses/logistic_loss.py)

```python
d_loss = self.softplus(-d_real) + self.softplus(d_fake)
g_loss = self.softplus(-d_fake)
```

## examples

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

```javascript
{                                                                                       
  "class": "function:hypergan.losses.logistic_loss.LogisticLoss"
}
```

## options

| attribute | description                                                                          | type             |
| --------- | ------------------------------------------------------------------------------------ | ---------------- |
| beta      | <https://pytorch.org/docs/stable/_modules/torch/nn/modules/activation.html#Softplus> | float (optional) |
| threshold | <https://pytorch.org/docs/stable/_modules/torch/nn/modules/activation.html#Softplus> | float (optional) |
