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

# Trainer

## Creation

The trainer creates the optimizer, and any associated train hooks.

```python
trainable_gan = TrainableGAN(gan)
```

## Access

```
trainable_gan.trainer
```

## Actions

```python
trainer.step(feed_dict) # Step forward
```

## Events

```python
trainer.before_step(step, feed_dict)
trainer.after_step(step, feed_dict)
```
