Tensorflow :: ops :: FakeQuantWithMinMaxVarsPerChannel
#include <array_ops.h>
Fake-quantisieren Sie den 'Inputs'-Tensor vom Typ float und eine der Formen: [d]
,.
Zusammenfassung
[b, d]
[b, h, w, d]
über Kanal kanalisiert min
und max
der Form [d]
um einen Tensor mit der gleichen Form wie die inputs
.
[min; max]
Definieren Sie den Klemmbereich für die inputs
. inputs
Werte werden in den Quantisierungsbereich quantisiert ( [0; 2^num_bits - 1]
, wenn narrow_range
ist falsch und [1; 2^num_bits - 1]
, wenn es wahr ist ) , und dann de-quantisiert und ausgegeben als Schwimmer in [min; max]
Intervall. num_bits
ist die Bitbreite der Quantisierung; zwischen 2 und 16 einschließlich.
Vor der Quantisierung werden die min
und max
Werte mit der folgenden Logik angepasst. Es wird empfohlen, min <= 0 <= max
. Wenn 0
nicht im Wertebereich liegt, kann das Verhalten unerwartet sein: Wenn 0 < min < max
: min_adj = 0
und max_adj = max - min
. Wenn min < max < 0
: min_adj = min - max
und max_adj = 0
. Wenn min <= 0 <= max
: scale = (max - min) / (2^num_bits - 1)
, min_adj = scale * round(min / scale)
und max_adj = max + min_adj - min
.
Diese Operation hat einen Gradienten und ermöglicht somit das Trainieren von min
und max
Werten.
Argumente:
- scope: Ein Scope- Objekt
Kehrt zurück:
-
Output
: Der Ausgangstensor.
Konstruktoren und Destruktoren | |
---|---|
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) |
Öffentliche Attribute | |
---|---|
operation | |
outputs |
Öffentliche Funktionen | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Öffentliche statische Funktionen | |
---|---|
NarrowRange (bool x) | |
NumBits (int64 x) |
Strukturen | |
---|---|
tensorflow :: ops :: FakeQuantWithMinMaxVarsPerChannel :: Attrs | Optionale Attributsetzer für FakeQuantWithMinMaxVarsPerChannel . |
Öffentliche Attribute
Operation
Operation operation
Ausgänge
::tensorflow::Output outputs
Öffentliche Funktionen
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 )
Knoten
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const
Öffentliche statische Funktionen
Engen Bereich
Attrs NarrowRange( bool x )
NumBits
Attrs NumBits( int64 x )