2017-07-02 188 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