--pass在Python VowpalWabbit中有什么作用? [英] What does --passes do in Python VowpalWabbit?
问题描述
-passes标志是训练通过的次数.但是,尚不清楚通过概念在训练Python VW模型(例如在for循环内)时意味着什么.
The --passes flag is the number of training passes. But it's unclear what the notion of passes means when training a Python VW model, within a for loop for example.
例如如果我正在像这样的for循环中训练一个示例的示例,则该示例:
e.g. If I'm training a model example by example within a for-loop like this:
for line in train:
model.learn(line)
如果每个训练样本仅从中学习一次,怎么会有多次通过?
How could there be multiple passes if each training sample is learned from only once?
推荐答案
在Python中,passes
选项仅在使用内置驱动程序时有效.仅当在VW对象的配置中指定了数据文件和/或传递时,才会发生这种情况.它不会引起model.learn(line)
的不同行为.
In Python the passes
option only affect when the inbuilt driver is used. This only occurs when a data file and or passes is specified in the configuration for the VW object. It does not cause different behavior for model.learn(line)
.
这是运行内置解析器的检查(在Python代码内部):
This is the check (internally to the Python code) for running the inbuilt parser:
class vw(pylibvw.vw):
def __init__(self, arg_str=None, **kw):
# ...
ext_file_args = ['d', 'data', 'passes']
if any(x in kw for x in ext_file_args):
pylibvw.vw.run_parser(self)
这是由大众首先将其作为命令行工具引起的令人困惑的情况之一.显然,在进行绑定时,最好弄清楚一点.
This is one of those confusing cases caused by the fact VW was as a command line tool first. This is definitely something it would be good to make clearer as we work on the bindings.
这篇关于--pass在Python VowpalWabbit中有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!