One-hot,In-place

One-hot

在数位电路中被用来表示一种特殊的位元组合,该字节里,仅容许单一位元为1,其他位元都必须为0。之所以称为one-hot就是因为只能有一个1(hot)。若情况相反,只有一个0,其余为1,则称为one-cold[1]。在机器学习里,也有one-hot向量(英语:one-hot vector)的概念。在一任意维度的向量中,仅有一个维度的值是1,其余为0。譬如向量 {\displaystyle [0\ 0\ 0\ 0\ 0\ 1\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0\ 0]},即为15维空间中的一组one-hot向量。将类别性资料转换成one-hot向量的过程则称one-hot编码(英语:one-hot encoding)[2]。在统计学中,虚拟变数代表了类似的概念。

One-hot目前并无公认或被广泛使用的中文译名。目前可见的one-hot encoding译名有独热编码[3] 以及一位有效编码[4]。

 in-place

Methods which mutate a tensor are marked with an underscore suffix. For example, torch.FloatTensor.abs_() computes the absolute value in-place and returns the modified tensor, while torch.FloatTensor.abs() computes the result in a new tensor.

Pytorch中带后缀下划线的函数为inplace,修改自身。

你可能感兴趣的:(AI,cnn,机器学习,人工智能)