AllenNLP實踐——命令行中覆蓋配置文件參數

以train命令爲例,可以設置若干參數,如’–serialization-dir’,’–recover’,’–overrides’,’–file-friendly-logging’。

'–overrides’這一項可以對json配置文件的某些項進行覆蓋,官方對這一項的幫助如下:

a JSON structure used to override the experiment configuration

即使用一個json,修改配置文件的某些項。比如需要iterator的batch_size,可以這樣寫:

-o {\\"iterator.batch_size\\":16}

也就是從配置文件遞歸地找到需要設置的那一項,中間用句號“.”分割開。
以下是我改的help:

a JSON structure used to override the experiment configuration,’
',e.g.{\“iterator.batch_size\”:16}, the key means to recursively ’
'look for a key in the parameter file, each key is separated by “.”

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章