テンソルフロー::作戦:: FakeQuantWithMinMaxVars

#include <array_ops.h>

グローバル float スカラーminを介して float 型の「入力」テンソルを疑似量子化します。

まとめ

およびmaxは、 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 - minmin < max < 0の場合: min_adj = min - maxおよびmax_adj = 0min <= 0 <= maxの場合: scale = (max - min) / (2^num_bits - 1)min_adj = scale * round(min / scale)max_adj = max + min_adj - min

この操作には勾配があるため、 minmax値のトレーニングが可能になります。

引数:

戻り値:

  • Output : 出力テンソル。

コンストラクターとデストラクター

FakeQuantWithMinMaxVars (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, :: tensorflow::Input min, :: tensorflow::Input max)
FakeQuantWithMinMaxVars (const :: tensorflow::Scope & scope, :: tensorflow::Input inputs, :: tensorflow::Input min, :: tensorflow::Input max, const FakeQuantWithMinMaxVars::Attrs & attrs)

パブリック属性

operation
outputs

公共機能

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

パブリック静的関数

NarrowRange (bool x)
NumBits (int64 x)

構造体

tensorflow:: ops:: FakeQuantWithMinMaxVars:: Attrs

FakeQuantWithMinMaxVarsのオプションの属性セッター。

パブリック属性

手術

Operation operation

出力

::tensorflow::Output outputs

公共機能

FakeQuantWithMinMaxVars

 FakeQuantWithMinMaxVars(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input inputs,
  ::tensorflow::Input min,
  ::tensorflow::Input max
)

FakeQuantWithMinMaxVars

 FakeQuantWithMinMaxVars(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input inputs,
  ::tensorflow::Input min,
  ::tensorflow::Input max,
  const FakeQuantWithMinMaxVars::Attrs & attrs
)

ノード

::tensorflow::Node * node() const 

演算子::tensorflow::入力

 operator::tensorflow::Input() const 

演算子::tensorflow::出力

 operator::tensorflow::Output() const 

パブリック静的関数

狭い範囲

Attrs NarrowRange(
  bool x
)

ビット数

Attrs NumBits(
  int64 x
)