Skip to content

Commit

Permalink
DOC: Update autoannoate tutorial, fix #768 (#769)
Browse files Browse the repository at this point in the history
* Fix doc/toml/gy6or6_eval.toml

* Fix doc/toml/gy6or6_predict.toml

* Update get_started/autoannotate.md, fix #768

* Fixup fix autoannotate.md
  • Loading branch information
NickleDave authored Aug 12, 2024
1 parent f007f5c commit 43d5a3c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 14 deletions.
16 changes: 12 additions & 4 deletions doc/get_started/autoannotate.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ where to find those files when we need them below.
root_results_dir = "/home/users/You/Data/vak_tutorial_data/vak/train/results"
```

Here it's fine to use the same directory you created before, or make a new one if you prepare to keep the
Here it's fine to use the same directory you created before, or make a new one if you prefer to keep the
training data and the files from training the neural network separate.
`vak` will make a new directory inside of `root_results_dir` to save the files related to training
every time that you run the `train` command.
Expand Down Expand Up @@ -357,10 +357,18 @@ spect_scaler = "/home/users/You/Data/vak_tutorial_data/vak_output/results_{times
```

The last path you need is actually in the TOML file that we used
to train the neural network: `dataset_path`.
You should copy that `dataset_path` option exactly as it is
and then paste it at the bottom of the `[EVAL]` table
to train the neural network: the dataset `path`.
You should copy that `path` option exactly as it is
and then paste it at the bottom of the `[vak.eval.dataset]` table
in the configuration file for evaluation.

```toml
[vak.eval.dataset]
# copy the dataset path from the train config file here;
# we will use the "test" split from that dataset, that we already prepared
path = "/home/users/You/Data/vak_tutorial_data/vak/prep/train/dataset_prepared_20240811"
```

We do this instead of preparing another dataset,
because we already created a test split when we ran
`vak prep` with the training configuration.
Expand Down
15 changes: 10 additions & 5 deletions doc/toml/gy6or6_eval.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,17 @@ min_segment_dur = 0.02

# dataset.params = parameters used for datasets
# for a frame classification model, we use dataset classes with a specific `window_size`
[vak.eval.dataset.params]
window_size = 176
[vak.eval.dataset]
path = "/copy/path/from/train/config/here"
params = { window_size = 176 }

# We put this table though vak knows which model we are using
[vak.eval.model.TweetyNet.network]
# hidden_size: the number of elements in the hidden state in the recurrent layer of the network
# we trained with hidden size = 256 so we need to evaluate with the same hidden size;
# otherwise we'll get an error about "shapes do not match" when torch tries to load the checkpoint
hidden_size = 256

# Note we do not specify any options for the model, and just use the defaults
# We need to put this table here though so we know which model we are using
[vak.eval.model.TweetyNet]

# this sub-table configures the `lightning.pytorch.Trainer`
[vak.eval.trainer]
Expand Down
14 changes: 9 additions & 5 deletions doc/toml/gy6or6_predict.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,16 @@ min_segment_dur = 0.01

# dataset.params = parameters used for datasets
# for a frame classification model, we use dataset classes with a specific `window_size`
[vak.predict.dataset.params]
window_size = 176
[vak.predict.dataset]
path = "/copy/path/from/train/config/here"
params = { window_size = 176 }

# Note we do not specify any options for the network, and just use the defaults
# We need to put this table here though, to indicate which model we are using.
[vak.predict.model.TweetyNet]
# We put this table though vak knows which model we are using
[vak.predict.model.TweetyNet.network]
# hidden_size: the number of elements in the hidden state in the recurrent layer of the network
# we trained with hidden size = 256 so we need to evaluate with the same hidden size;
# otherwise we'll get an error about "shapes do not match" when torch tries to load the checkpoint
hidden_size = 256

# this sub-table configures the `lightning.pytorch.Trainer`
[vak.predict.trainer]
Expand Down

0 comments on commit 43d5a3c

Please sign in to comment.