Multithreading 如何启用多核选项来培训斯坦福NER模型?
斯坦福crf分类器是否支持多核操作 如果是,我如何启用它 我尝试了Multithreading 如何启用多核选项来培训斯坦福NER模型?,multithreading,machine-learning,nlp,stanford-nlp,Multithreading,Machine Learning,Nlp,Stanford Nlp,斯坦福crf分类器是否支持多核操作 如果是,我如何启用它 我尝试了nthreads参数,但它显示: 未知属性:| n读取| 对于培训期间的多线程,请尝试选项-multi-threadgrad。 对于测试期间的多线程,请尝试选项-multi-threadclassifier。好问题-我和你在同一条船上时投了赞成票。安琪尔的回答对我也有帮助,尽管只是部分帮助。我必须深入研究代码,找出它是什么以及如何指定。以下是它的主要用途: new MulticoreWrapper<Pair<Integ
nthreads
参数,但它显示:
未知属性:| n读取|
对于培训期间的多线程,请尝试选项-multi-threadgrad。
对于测试期间的多线程,请尝试选项-multi-threadclassifier。好问题-我和你在同一条船上时投了赞成票。安琪尔的回答对我也有帮助,尽管只是部分帮助。我必须深入研究代码,找出它是什么以及如何指定。以下是它的主要用途:
new MulticoreWrapper<Pair<Integer, List<Integer>>, Pair<Integer, Double>> (multiThreadGrad, (calculateEmpirical ? expectedAndEmpiricalThreadProcessor : expectedThreadProcessor) )
新的多重写器(多线程梯度,(计算-经验-预期和经验读处理器:预期线程处理器))
根据multicwreper
doc第一个参数:
nThreads-如果小于或等于0,则自动确定
线程数。否则,基础结构的大小
线程池
因此,我现在在一台有8个内核的机器上指定了-multi-threadgrad 16
,尽管我不知道16是线程太多还是太少 尝试使用--multi-threadgrad 8
例如:
java-Xmx20g-XX:+UseG1GC-cp/path/to/stanford/ner/jar edu.stanford.nlp.ie.crf.crfclassizer-prop/prop/file/name-basic.prop--multi-threadgrad 8
还可以使用Runtime.getRuntime().availableProcessors()动态设置该值
src: