From 21be547d31b04ac254921030cd2f931007ea41e5 Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Sun, 11 Aug 2024 21:31:43 -0400 Subject: [PATCH 1/4] Fix doc/toml/gy6or6_eval.toml --- doc/toml/gy6or6_eval.toml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/doc/toml/gy6or6_eval.toml b/doc/toml/gy6or6_eval.toml index 434576d71..0f6bad0b4 100644 --- a/doc/toml/gy6or6_eval.toml +++ b/doc/toml/gy6or6_eval.toml @@ -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] From 3b3f72985ed6b79a5a75f3c0967d9e5e8c170550 Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Sun, 11 Aug 2024 21:31:51 -0400 Subject: [PATCH 2/4] Fix doc/toml/gy6or6_predict.toml --- doc/toml/gy6or6_predict.toml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/toml/gy6or6_predict.toml b/doc/toml/gy6or6_predict.toml index 5061488be..b82cf048c 100644 --- a/doc/toml/gy6or6_predict.toml +++ b/doc/toml/gy6or6_predict.toml @@ -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] From 1518ce054217c5b6042847c7aecf38f5db12743c Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Sun, 11 Aug 2024 21:32:07 -0400 Subject: [PATCH 3/4] Update get_started/autoannotate.md, fix #768 --- doc/get_started/autoannotate.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/get_started/autoannotate.md b/doc/get_started/autoannotate.md index 37ba9eef9..dd71f5d69 100644 --- a/doc/get_started/autoannotate.md +++ b/doc/get_started/autoannotate.md @@ -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. @@ -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. From 97a549cf79cf071de19dac44a07ca1de4310053e Mon Sep 17 00:00:00 2001 From: David Nicholson Date: Sun, 11 Aug 2024 21:43:39 -0400 Subject: [PATCH 4/4] Fixup fix autoannotate.md --- doc/get_started/autoannotate.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/get_started/autoannotate.md b/doc/get_started/autoannotate.md index dd71f5d69..f382c6863 100644 --- a/doc/get_started/autoannotate.md +++ b/doc/get_started/autoannotate.md @@ -366,7 +366,7 @@ in the configuration file for evaluation. [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" +path = "/home/users/You/Data/vak_tutorial_data/vak/prep/train/dataset_prepared_20240811" ``` We do this instead of preparing another dataset,