Skip to content

Commit c272964

Browse files
committed
add readme for gridsearch
1 parent a9e934c commit c272964

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

gridsearch.md

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# ABnet3 cli documentation
2+
3+
This file explains how to use the ABNet3 cli `abnet3-gridsearch`
4+
5+
The abnet3 cli is designed to take all its parameters as yaml file.
6+
You can see examples of such yaml files in test/data/buckeye.yaml and
7+
test/data/test_embedding.yaml.
8+
9+
## Run one training
10+
11+
To run one training, you must create your yaml file containing the training
12+
parameters, and then run the `abnet3-gridsearch parameters.yaml` command.
13+
14+
The yaml file is designed as following:
15+
16+
```yaml
17+
default_params:
18+
pathname_experience: path/to/experience
19+
features:
20+
class: FeaturesGenerator
21+
arguments:
22+
run: never
23+
...
24+
dataloader:
25+
class: OriginalDataLoader
26+
arguments:
27+
sampler:
28+
class: SamplerClusterSiamese
29+
arguments:
30+
run: always
31+
seed: 0
32+
model:
33+
class: SiameseNetwork
34+
arguments:
35+
input_dim: 280
36+
loss:
37+
class: coscos2
38+
arguments:
39+
trainer:
40+
class: TrainerSiamese
41+
arguments:
42+
embedder:
43+
class: EmbedderSiamese
44+
arguments:
45+
```
46+
47+
You must define all the arguments for the `features`, `dataloader`, `sampler`,
48+
`model`, `trainer`, `loss` and `embedder` classes (and their class name as
49+
well).
50+
51+
### Inputs and outputs
52+
53+
- The wav files have to be defined in `features.arguments.files`. This is
54+
not mandatory if the features are already generated.
55+
- You can define the path to the output features
56+
in `features.arguments.output_path`
57+
- The cluster file has to be defined in the sampler params
58+
- The input features of the dataloader will automatically be defined
59+
as the output of the features generator. But this can be overridden in the
60+
arguments
61+
- As well, the input to the embedding will automatically be defined as the output
62+
features of the features generator. This can also be overridden.
63+
64+
65+
### features.run and sampler.run
66+
67+
The `run` arguments are special : they allow you to control the feature
68+
generation or the sampling.
69+
70+
You can use `never`, `always`, `once` or `if_none`.
71+
72+
## Run a gridsearch over a certain parameter
73+
74+
You can add at the end of the yaml file the following portion :
75+
76+
```yaml
77+
grid_params:
78+
sampler:
79+
arguments:
80+
type_sampling_mode: ['log','fcube','f','f2','1']
81+
```
82+
83+
This will run a gridsearch over the parameter `type_sampling_mode` of the
84+
sampler.
85+
The gridsearch can only loop over one argument. If you put several arguments
86+
in the grid_params, they will be launched one by one.
87+

0 commit comments

Comments
 (0)