本文整理汇总了Python中fairseq.criterions.build_criterion方法的典型用法代码示例。如果您正苦于以下问题:Python criterions.build_criterion方法的具体用法?Python criterions.build_criterion怎么用?Python criterions.build_criterion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fairseq.criterions
的用法示例。
在下文中一共展示了criterions.build_criterion方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_criterion
# 需要导入模块: from fairseq import criterions [as 别名]
# 或者: from fairseq.criterions import build_criterion [as 别名]
def build_criterion(self, args):
return criterions.build_criterion(args, self)
示例2: build_criterion
# 需要导入模块: from fairseq import criterions [as 别名]
# 或者: from fairseq.criterions import build_criterion [as 别名]
def build_criterion(self, args):
"""
Build the :class:`~fairseq.criterions.FairseqCriterion` instance for
this task.
Args:
args (argparse.Namespace): parsed command-line arguments
Returns:
a :class:`~fairseq.criterions.FairseqCriterion` instance
"""
from fairseq import criterions
return criterions.build_criterion(args, self)
示例3: build_criterion
# 需要导入模块: from fairseq import criterions [as 别名]
# 或者: from fairseq.criterions import build_criterion [as 别名]
def build_criterion(self, args):
from fairseq import criterions
return criterions.build_criterion(args, self)
示例4: build_criterion
# 需要导入模块: from fairseq import criterions [as 别名]
# 或者: from fairseq.criterions import build_criterion [as 别名]
def build_criterion(self):
"""Set up the grader."""
# TorchAgent will call this without ready=True before self.args is ready
return criterions.build_criterion(self.args, self.task)
示例5: build_criterion
# 需要导入模块: from fairseq import criterions [as 别名]
# 或者: from fairseq.criterions import build_criterion [as 别名]
def build_criterion(self, args):
"""
Build the :class:`~fairseq.criterions.FairseqCriterion` instance for
this task.
Args:
args (argparse.Namespace): parsed command-line arguments
Returns:
a :class:`~fairseq.criterions.FairseqCriterion` instance
"""
from fairseq import criterions
return criterions.build_criterion(args, self)