More details required - how to change hyperparameters from CLI #5671
Replies: 5 comments
-
I think this comment in the docs refers to two things:
Which basically means that you can either set the argument values when calling a specific script, or set them as environment variables. In this case, the latter gets precedence as you can see from the code. We've noticed that this practice has made it difficult to understand which parameters are set by which process and to which value, and as I just explained in your other issue, spaCy v.3 will deal with such hyperparameters quite differently by setting them specifically in a config file. For now though in spaCy v.2, I think the most straightforward path is to just define the parameters you need as arguments for the script you're invoking. For instance,
|
Beta Was this translation helpful? Give feedback.
-
@svlandeg but what about parameters like dropout? I don't see this as an option as a cli argument. (although it seems to be an option for |
Beta Was this translation helpful? Give feedback.
-
I'm afraid that for now, your best option is to look in the code itself:
|
Beta Was this translation helpful? Give feedback.
-
@svlandeg to be clear I just wanted to verify if you are saying to find the matching CLI argument for the corresponding hyperparameter. If that is true, dropout doesn't have a matching CLI argument I can use to set such value It exists for
|
Beta Was this translation helpful? Give feedback.
-
Sorry that the current situation is confusing. Sometimes the parameters can be set through the CLI arguments, sometimes through environment variables, sometimes both options are possible and you'd actually have to check the code which takes precedence. In the case of dropout for the train script, you can set it only with environment variables - cf the code I cited. These environment variables are read in
I personally wouldn't really recommend setting these env. variables, unless you keep it well-documented on your end. You can find a list of them here. You can ofcourse also tweak the local version of the |
Beta Was this translation helpful? Give feedback.
-
Which page or section is this issue related to?
https://spacy.io/api/cli#train
It says
However I tried this from the Windows command prompt and if you prepend the hyperparameters before calling python it complains that the command is not found.
Where is spacy reading these values from and how to set them on a Windows system.?
Beta Was this translation helpful? Give feedback.
All reactions