tensorflow:: ops:: FakeQuantWithMinMaxVarsPerChannel
#include <array_ops.h> float 型の 'inputs' テンソルと、形状の 1 つを擬似的に量子化します: [d] 、。
まとめ
[b, d] [b, h, w, d]は、チャネルごとの浮動小数点数のminとmax (形状[d]を介して、 inputsと同じ形状の「出力」テンソルに変換されます。
[min; max]はinputsデータのクランプ範囲を定義します。 inputs値は量子化範囲 ( narrow_rangeが false の場合は[0; 2^num_bits - 1] 、true の場合は[1; 2^num_bits - 1] ) に量子化され、その後逆量子化されて[min; max]区間の浮動小数点数として出力されます。num_bits num_bits量子化のビット幅で、2 から 16 までの範囲です。
量子化の前に、 minとmax値は次のロジックで調整されます。min min <= 0 <= maxにすることが推奨されます。0 0値の範囲にない場合、予期しない動作が発生する可能性があります。0 0 < min < maxの場合: min_adj = 0およびmax_adj = max - min min < max < 0の場合: min_adj = min - maxおよびmax_adj = 0 min <= 0 <= maxの場合: scale = (max - min) / (2^num_bits - 1) 、 min_adj = scale * round(min / scale)およびmax_adj = max + min_adj - min 。
この演算には勾配が存在するため、 minとmax値を学習することが可能です。
議論:
- スコープ:スコープオブジェクト
返品:
-
Output:出力テンソル。
コンストラクターとデストラクタ | |
|---|---|
FakeQuantWithMinMaxVarsPerChannel (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, :: tensorflow::Input min, :: tensorflow::Input max) | |
FakeQuantWithMinMaxVarsPerChannel (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, :: tensorflow::Input min, :: tensorflow::Input max, const FakeQuantWithMinMaxVarsPerChannel::Attrs & attrs) |
公開属性 | |
|---|---|
operation | |
outputs | |
公的機能 | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
パブリック静的関数 | |
|---|---|
NarrowRange (bool x) | |
NumBits (int64 x) | |
構造 | |
|---|---|
| tensorflow:: ops:: FakeQuantWithMinMaxVarsPerChannel:: Attrs | FakeQuantWithMinMaxVarsPerChannelのオプション属性設定子。 |
公開属性
手術
Operation operation
出力
::tensorflow::Output outputs
公的機能
FakeQuantWithMinMaxVarsPerChannel
FakeQuantWithMinMaxVarsPerChannel( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input min, ::tensorflow::Input max )
FakeQuantWithMinMaxVarsPerChannel
FakeQuantWithMinMaxVarsPerChannel( const ::tensorflow::Scope & scope, ::tensorflow::Input inputs, ::tensorflow::Input min, ::tensorflow::Input max, const FakeQuantWithMinMaxVarsPerChannel::Attrs & attrs )
ノード
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
パブリック静的関数
狭い範囲
Attrs NarrowRange( bool x )
ビット数
Attrs NumBits( int64 x )