Skip to content

Commit

Permalink
Update README.md (#282)
Browse files Browse the repository at this point in the history
* Update README.md

* Add gan gif to README

* Update readme

* Update readme

* Add gif to gan example

* Optimise gif
  • Loading branch information
ethanwharris authored and MattPainter01 committed Aug 3, 2018
1 parent c3074a3 commit 6243524
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ torchbearer: A model training library for researchers using PyTorch
- [About](#about)
- [Key Features](#features)
- [Installation](#installation)
- [Examples](#examples)
- [Quickstart](#quick)
- [Documentation](#docs)
- [Other Libraries](#others)
Expand All @@ -15,7 +16,7 @@ torchbearer: A model training library for researchers using PyTorch

## About

Torchbearer is a PyTorch model training library designed by researchers, for researchers. Specifically, if you occasionally want to perform advanced custom operations but generally don't want to write hundreds of lines of untested code then this is the library for you. Our design decisions are geared towards flexibility and customisability whilst trying to maintain the simplest possible API.
Torchbearer is a PyTorch model fitting library designed for use by researchers (or anyone really) working in deep learning or differentiable programming. Specifically, if you occasionally want to perform advanced custom operations but generally don't want to write hundreds of lines of untested code then this is the library for you. Our design decisions are geared towards flexibility and customisability whilst trying to maintain the simplest possible API.

<a name="features"/>

Expand All @@ -26,7 +27,7 @@ Torchbearer is a PyTorch model training library designed by researchers, for res
- Simple [callback API](http://torchbearer.readthedocs.io/en/latest/code/callbacks.html) with a persistent model state that supports adding to the loss or accessing the metric values
- A host of callbacks included from the start that enable: [tensorboard logging](http://torchbearer.readthedocs.io/en/latest/code/callbacks.html#module-torchbearer.callbacks.tensor_board) (for metrics, images and data), [model checkpointing](http://torchbearer.readthedocs.io/en/latest/code/callbacks.html#module-torchbearer.callbacks.checkpointers), [weight decay](http://torchbearer.readthedocs.io/en/latest/code/callbacks.html#module-torchbearer.callbacks.weight_decay), [learning rate schedulers](http://torchbearer.readthedocs.io/en/latest/code/callbacks.html#module-torchbearer.callbacks.torch_scheduler), [gradient clipping](http://torchbearer.readthedocs.io/en/latest/code/callbacks.html#module-torchbearer.callbacks.gradient_clipping) and more
- Decorator APIs for [metrics](http://torchbearer.readthedocs.io/en/latest/code/metrics.html#module-torchbearer.metrics.decorators) and [callbacks](http://torchbearer.readthedocs.io/en/latest/code/callbacks.html#module-torchbearer.callbacks.decorators) that allow for simple construction of callbacks and metrics
- An [example library](http://torchbearer.readthedocs.io/en/latest/examples/quickstart.html) (still under construction) with a set of demos showing how complex models (such as [GANs](http://torchbearer.readthedocs.io/en/latest/examples/gan.html) and [VAEs](http://torchbearer.readthedocs.io/en/latest/examples/vae.html)) can be implemented easily with torchbearer
- An [example library](http://torchbearer.readthedocs.io/en/latest/examples/quickstart.html) (still under construction) with a set of demos showing how complex deep learning models (such as [GANs](http://torchbearer.readthedocs.io/en/latest/examples/gan.html) and [VAEs](http://torchbearer.readthedocs.io/en/latest/examples/vae.html)) and differentiable programs (like [SVMs](http://torchbearer.readthedocs.io/en/latest/examples/svm_linear.html)) can be implemented easily with torchbearer
- Fully tested; as researchers we want to trust that our metrics and callbacks work properly, we have therefore tested everything thouroughly for peace of mind

<a name="installation"/>
Expand All @@ -37,6 +38,18 @@ The easiest way to install torchbearer is with pip:

`pip install torchbearer`

<a name="examples"/>

## Examples

Here's a linear SVM (differentiable program) visualisation from the [docs](http://torchbearer.readthedocs.io/en/latest/examples/svm_linear.html) implemented using torcbearer and pytorch in less than 100 lines of code:

![SVM fitting](https://raw.githubusercontent.com/ecs-vlc/torchbearer/master/docs/_static/img/svm_fit.gif)

And a GAN visualisation from the [docs](http://torchbearer.readthedocs.io/en/latest/examples/gan.html) implemented using torcbearer and pytorch:

![GAN Gif](https://raw.githubusercontent.com/ecs-vlc/torchbearer/master/docs/_static/img/gan.gif)

<a name="quick"/>

## Quickstart
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/examples/gan.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ def process(self, state):
return state[D_LOSS]


torchbearermodel = tb.Model(model, optim, loss_criterion=None, metrics=['loss', g_loss(), d_loss()])
torchbearermodel = tb.Model(model, optim, criterion=None, metrics=['loss', g_loss(), d_loss()])
torchbearermodel.to(device)
torchbearermodel.fit_generator(dataloader, epochs=200, pass_state=True, callbacks=[loss_callback, saver_callback])
Binary file added docs/_static/img/gan.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions docs/examples/gan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ We borrow the image saving method from PyTorch_GAN_ and put it in a call back to
:language: python
:lines: 115-119

After 172400 iterations we see the following.
Here is a Gif created from the saved images.

.. figure:: /_static/img/172400.png
.. figure:: /_static/img/gan.gif
:scale: 200 %
:alt: GAN generated samples after 172400 iterations
:alt: GAN generated samples


Source Code
Expand Down

0 comments on commit 6243524

Please sign in to comment.