weight:(张量,可选)可以指定⼀个⼀维的Tensor,⽤来设置每个类别的权重。⽤C表⽰类别的个数,Tensor的长度应该为C。当训练集不平衡时该参数⼗分有⽤。
tetrasize_average:(最新的版本已弃⽤)(bool,可选)默认情况下为True,此时损失是每个minibatch的平均;如果设置成Fal,则对每个minibatch求和。这个属性只有当reduce参数设置成True时才⽣效。
voa newsreduce:(最新的版本已弃⽤) (bool,可选)默认情况下为True,此时损失为根据size_average参数的值计算每个minibatch的和或者是平均;如果设置成Fal,忽略size_average参数的值,并返回每个元素的损失。
excitedlyignore_index:(int,可选)可以设置⼀个被忽略值,使这个值不会影响到输⼊的梯度的计算。当size_average为True时,loss的平均值也会忽略该值。
reduction: (string,可选)”none”:不应⽤任何缩减,“mean”:取输出的加权平均值,“sum”:输出将被求和。注意:size_average和reduce正在被弃⽤,同时,指定这两个参数之⼀将覆盖reduction。默认:
‘mean’
下⾯时pytorch官⽹上的⽂档:
mask是什么意思
Parameters
weight (Tensor, optional) – a manual rescaling weight given to each class. If given, has to be a Tensor of size C
size_average (bool, optional) – Deprecated (e reduction). By default, the loss are averaged over each loss element in the batch. Note that for some loss, there are multiple elements per sample. If the field size_average is t to Fal, the loss are instead summed for each minibatch. Ignored when reduce is Fal. Default: True自然拼读法
99宿舍网六级成绩查询farewell什么意思ignore_index (int, optional) – Specifies a target value that is ignored and does not contribute to the input gradient. When size_average is True, the loss is averaged over non-ignored targets.
reduce (bool, optional) – Deprecated (e reduction). By default, the loss are averaged or summed over obrvations for each minibatch depending on size_average. When reduce is Fal, returns a loss per batch element instead and ignores
职称英语考试报名条件
size_average. Default: True
reduction (string, optional) – Specifies the reduction to apply to the output: ‘none’ | ‘mean’ | ‘sum’. ‘none’: no reduction will be applied, ‘mean’: the weighted mean of the output is taken, ‘sum’: the output will be summed. Note: size_average and reduce are in the process of being deprecated, and in the meantime, specifying either of tho two args will override reduction. Default: ‘mean’
托福培训费用