テンソルフロー::作戦:: FakeQuantWithMinMaxVarsPerChannel
#include <array_ops.h>チャネルごとの float を介して float 型の「入力」テンソルを疑似量子化します。
まとめ
チャネルごとの float 型と形状[d] 、 [b, d] [b, h, w, d]のいずれかのinputsテンソルを、チャネルごとの float のminとmax介して[d]に疑似量子化します。 inputsと同じ形状のテンソルoutputs 。
属性
[min; max]inputsデータのクランプ範囲を定義します。-
inputs値は量子化範囲 (narrow_rangeが false の場合は[0; 2^num_bits - 1]、true の場合は[1; 2^num_bits - 1]) に量子化され、その後量子化解除され、[min; max]間隔。 -
num_bits量子化のビット幅です。 2 から 16 まで (両端の値を含む)
量子化の前に、 minとmax値は次のロジックで調整されます。 min <= 0 <= maxにすることをお勧めします。 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
演算子::tensorflow::入力
operator::tensorflow::Input() const
演算子::tensorflow::出力
operator::tensorflow::Output() const
パブリック静的関数
狭い範囲
Attrs NarrowRange( bool x )
ビット数
Attrs NumBits( int64 x )