optimize.optimize
optimize.optimize
Functions
Name | Description |
---|---|
optimize_one_measure | Optimize a single vowel measurement |
optimize_vowel_measures | Optimize a list of VowelMeasurements. |
run_optimize | Repeatedly run optimization until either max_iter is reached, |
optimize_one_measure
optimize.optimize.optimize_one_measure(vowel_measurement, optim_params, f1_cutoff=np.inf, f2_cutoff=np.inf)
Optimize a single vowel measurement
This function optimizes a given vowel measurement based on the specified optimization parameters.
Parameters
Name | Type | Description | Default |
---|---|---|---|
vowel_measurement |
VowelMeasurement | The VowelMeasurement to optimize | required |
optim_params |
list[Literal[‘param_speaker_global’, ‘param_speaker_byvclass’, ‘bparam_speaker_global’, ‘bparam_speaker_byvclass’, ‘maxformant_speaker_global’, ‘param_corpus_byvowel’]] | The optimization parameters to use. Defaults to [ “param_speaker_global”, “param_speaker_byvclass”, “bparam_speaker_global”, “bparam_speaker_byvclass”, “maxformant_speaker_global” ]. | required |
f1_cutoff |
float | np.float64 | The maximum considerable F1 value | np.inf |
f2_cutoff |
float | np.float64 | The maximum considerable F2 value | np.inf |
Returns
Type | Description |
---|---|
int | description |
optimize_vowel_measures
optimize.optimize.optimize_vowel_measures(vowel_measurements, optim_params, f1_cutoff=np.inf, f2_cutoff=np.inf, pbar=None)
Optimize a list of VowelMeasurements.
Parameters
Name | Type | Description | Default |
---|---|---|---|
vowel_measurements |
list[VowelMeasurement] | The list of vowel measurements to optimize | required |
optim_params |
list[Literal[‘param_speaker_global’, ‘param_speaker_byvclass’, ‘bparam_speaker_global’, ‘bparam_speaker_byvclass’, ‘maxformant_speaker_global’, ‘param_corpus_byvowel’]] | The optimization parameters to use. Defaults to [ “param_speaker_global”, “param_speaker_byvclass”, “bparam_speaker_global”, “bparam_speaker_byvclass”, “maxformant_speaker_global” ]. | required |
f1_cutoff |
float | np.float64 | The maximum considerable F1 value | np.inf |
f2_cutoff |
float | np.float64 | The maximum considerable F2 value | np.inf |
pbar |
tqdm |
A progress bar. | None |
run_optimize
optimize.optimize.run_optimize(vowel_system, optim_params=['param_speaker', 'fratio_speaker', 'centroid_speaker', 'maxformant_speaker'], f1_cutoff=np.inf, f2_cutoff=np.inf, max_iter=10)
Repeatedly run optimization until either max_iter
is reached, or the difference between two iterations becomes small.
Parameters
Name | Type | Description | Default |
---|---|---|---|
vowel_system |
VowelClassCollection | The vowel space to be optimized | required |
optim_params |
list[Literal[‘param_speaker_global’, ‘param_speaker_byvclass’, ‘bparam_speaker_global’, ‘bparam_speaker_byvclass’, ‘maxformant_speaker_global’, ‘param_corpus_byvowel’]] | The optimization parameters to use. Defaults to [ “param_speaker_global”, “param_speaker_byvclass”, “bparam_speaker_global”, “bparam_speaker_byvclass”, “maxformant_speaker_global” ]. | ['param_speaker', 'fratio_speaker', 'centroid_speaker', 'maxformant_speaker'] |
f1_cutoff |
float | np.float64 | The maximum considerable F1 value | np.inf |
f2_cutoff |
float | np.float64 | The maximum considerable F2 value | np.inf |
max_iter |
int | The maximum number of iterations to run. Defaults to 10. | 10 |