Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlight python codes at README.md #81

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The Experiment object is a subclass of Pytorch.SummaryWriter.

**Log and visualize with Tensorboard**

```{.python}
```python
from test-tube import Experiment
import torch

Expand All @@ -73,15 +73,15 @@ exp.save()
exp.close()
```

```{.bash}
```bash
pip install tensorflow

tensorboard --logdir /some/path
```

**Run grid search on SLURM GPU cluster**

``` {.python}
``` python
from test_tube.hpc import SlurmCluster

# hyperparameters is a test-tube hyper params object
Expand Down Expand Up @@ -110,7 +110,7 @@ cluster.optimize_parallel_cluster_gpu(train, nb_trials=20, job_name='first_tt_ba

**Optimize hyperparameters across GPUs**

``` {.python}
``` python
from test_tube import HyperOptArgumentParser

# subclass of argparse
Expand All @@ -133,7 +133,7 @@ hparams.optimize_parallel_gpu(MyModel.fit, gpu_ids=['1', '2,3', '0'], nb_trials=

Or... across CPUs

``` {.python}
``` python
hparams.optimize_parallel_cpu(MyModel.fit, nb_trials=192, nb_workers=12)
```

Expand All @@ -142,7 +142,7 @@ magnitudes of hyperparameter values, with a chosen base (disabled by
default). Keep in mind that the range you search over must be strictly
positive.

``` {.python}
```python
from test_tube import HyperOptArgumentParser

# subclass of argparse
Expand All @@ -163,7 +163,7 @@ for hparam_trial in hparams.trials(20):

### Convert your argparse params into searchable params by changing 1 line

``` {.python}
```python
import argparse
from test_tube import HyperOptArgumentParser

Expand All @@ -177,7 +177,7 @@ parser = HyperOptArgumentParser(description='Process some integers.', strategy='

### Log images inline with metrics

``` {.python}
```python
# name must have either jpg, png or jpeg in it
img = np.imread('a.jpg')
exp.log('test_jpg': img, 'val_err': 0.2)
Expand Down