2017-07-02 190 views

回答

5

bfloat16是一种特定于tensorflow的格式,其设计更易于从float32转换。它与IEEE自己的float16不同,因此是新名称。

sources

// Compact 16-bit encoding of floating point numbers. This representation uses 
// 1 bit for the sign, 8 bits for the exponent and 7 bits for the mantissa. It 
// is assumed that floats are in IEEE 754 format so the representation is just 
// bits 16-31 of a single precision float. 
// 
// NOTE: The IEEE floating point standard defines a float16 format that 
// is different than this format (it has fewer bits of exponent and more 
// bits of mantissa). We don't use that format here because conversion 
// to/from 32-bit floats is more complex for that format, and the 
// conversion for this format is very simple. 

至于量化整数,它们被设计在训练网络来取代浮点加快处理。基本上,它们是实数的一种固定点编码,尽管选择的操作范围表示在网络的任何给定点观察到的分布。

更多关于量化here

+0

谢谢。在源代码中还提到:“由于现有的IEEE float16类型,我们不会将其名称命名为”float16“,而只是使用”uint16“。” 为什么uint16?这可能是文档中的错误,它意味着要说bfloat16? – JMC

+1

我认为他们只是指[内部表示bfloat16的方式](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/core/framework/numeric_types.h#L49)。 – user1735003