Skip to content

Commit

Permalink
Feature/update quickstart (#208)
Browse files Browse the repository at this point in the history
* Add code download to quickstart

* Formatting

* Formatting

* Formatting

* Move example code files
  • Loading branch information
MattPainter01 authored and ethanwharris committed Jul 18, 2018
1 parent 84e70d5 commit f944722
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,4 @@ ENV/
.idea

# Ignore examples/data
examples/data
/docs/_static/examples/data
File renamed without changes.
14 changes: 11 additions & 3 deletions docs/examples/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Defining the Model

Let's get using torchbearer. Here's some data from Cifar10 and a simple 3 layer strided CNN:

.. literalinclude:: ../../examples/quickstart.py
.. literalinclude:: /_static/examples/quickstart.py
:language: python
:lines: 7-45

Expand All @@ -18,7 +18,7 @@ Instead, with torchbearer, we can define our optimiser and some metrics (just 'a
Training on Cifar10
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ../../examples/quickstart.py
.. literalinclude:: /_static/examples/quickstart.py
:lines: 47-53

Running the above produces the following output:
Expand Down Expand Up @@ -46,4 +46,12 @@ Running the above produces the following output:
8/10(t): 100%|██████████| 391/391 [00:01<00:00, 203.16it/s, running_acc=0.747, running_loss=0.736, acc=0.752, acc_std=0.432, loss=0.716, loss_std=0.0899]
8/10(v): 100%|██████████| 79/79 [00:00<00:00, 221.55it/s, val_acc=0.679, val_acc_std=0.467, val_loss=0.923, val_loss_std=0.113]
9/10(t): 100%|██████████| 391/391 [00:01<00:00, 213.23it/s, running_acc=0.756, running_loss=0.701, acc=0.759, acc_std=0.428, loss=0.695, loss_std=0.0915]
9/10(v): 100%|██████████| 79/79 [00:00<00:00, 245.33it/s, val_acc=0.676, val_acc_std=0.468, val_loss=0.951, val_loss_std=0.111]
9/10(v): 100%|██████████| 79/79 [00:00<00:00, 245.33it/s, val_acc=0.676, val_acc_std=0.468, val_loss=0.951, val_loss_std=0.111]
Source Code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The source code for the example is given below:

:download:`Download Python source code: quickstart.py </_static/examples/quickstart.py>`

0 comments on commit f944722

Please sign in to comment.