Tensorflow :: ops :: Conv2D
#include <nn_ops.h>
Berechnet eine 2-D-Faltung bei 4-D- input
und filter
.
Zusammenfassung
Bei einem Eingabetensor der Form [batch, in_height, in_width, in_channels]
und einem Filter- / Kernel-Tensor der Form [filter_height, filter_width, in_channels, out_channels]
führt diese [filter_height, filter_width, in_channels, out_channels]
Folgendes aus:
- Reduziert den Filter auf eine 2-D-Matrix mit der Form
[filter_height * filter_width * in_channels, output_channels]
. - Extrahiert Bildfelder aus dem Eingabetensor, um einen virtuellen Tensor der Form zu bilden
[batch, out_height, out_width, filter_height * filter_width * in_channels]
. - Für jedes Patch multipliziert rechts die Filtermatrix und den Bild-Patch-Vektor.
Im Detail mit dem Standard-NHWC-Format
output[b, i, j, k] = sum_{di, dj, q} input[b, strides[1] * i + di, strides[2] * j + dj, q] * filter[di, dj, q, k]
Muss strides[0] = strides[3] = 1
. Für den häufigsten Fall der gleichen horizontalen und vertikalen Schritte sind strides = [1, stride, stride, 1]
.
Argumente:
- scope: Ein Scope- Objekt
- Eingang: Ein 4-D-Tensor. Die Dimensionsreihenfolge wird gemäß dem Wert von
data_format
interpretiert.data_format
finden Sie weiter unten. - Filter: Ein 4-D-Tensor der Form
[filter_height, filter_width, in_channels, out_channels]
- Schritte: 1-D-Tensor der Länge 4. Der Schritt des Schiebefensters für jede
input
. Die Dimensionsreihenfolge wird durch den Wert vondata_format
bestimmt.data_format
finden Sie weiter unten. - padding: Die Art des zu verwendenden Auffüllalgorithmus.
Optionale Attribute (siehe Attrs
):
- explizite_Paddings: Wenn das
padding
"EXPLICIT"
, wird die Liste der expliziten"EXPLICIT"
. Für die i-te Dimension beträgt die vor und nach der Dimension eingefügte Auffüllmengeexplicit_paddings[2 * i]
bzw.explicit_paddings[2 * i + 1]
. Wennpadding
nicht ist"EXPLICIT"
,explicit_paddings
muss leer sein. - Datenformat: Geben Sie das Datenformat der Eingabe- und Ausgabedaten an. Mit dem Standardformat "NHWC" werden die Daten in der Reihenfolge gespeichert: [Stapel, Höhe, Breite, Kanäle]. Alternativ könnte das Format "NCHW" sein, die Datenspeicherreihenfolge von: [Stapel, Kanäle, Höhe, Breite].
- Dilatationen: 1-D-Tensor der Länge 4. Der Dilatationsfaktor für jede
input
. Wenn k> 1 eingestellt ist, werden zwischen jedem Filterelement in dieser Dimension k-1 übersprungene Zellen angezeigt. Die Dimensionsreihenfolge wird durch den Wert vondata_format
, siehe oben für Details. Die Dilatationen in den Chargen- und Tiefenabmessungen müssen 1 betragen.
Kehrt zurück:
-
Output
: Ein 4-D-Tensor. Die Dimensionsreihenfolge wird durch den Wert vondata_format
bestimmt.data_format
finden Sie weiter unten.
Konstruktoren und Destruktoren | |
---|---|
Conv2D (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding) | |
Conv2D (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding, const Conv2D::Attrs & attrs) |
Öffentliche Attribute | |
---|---|
operation | |
output |
Öffentliche Funktionen | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Öffentliche statische Funktionen | |
---|---|
DataFormat (StringPiece x) | |
Dilations (const gtl::ArraySlice< int > & x) | |
ExplicitPaddings (const gtl::ArraySlice< int > & x) | |
UseCudnnOnGpu (bool x) |
Strukturen | |
---|---|
tensorflow :: ops :: Conv2D :: Attrs | Optionale Attributsetzer für Conv2D . |
Öffentliche Attribute
Operation
Operation operation
Ausgabe
::tensorflow::Output output
Öffentliche Funktionen
Conv2D
Conv2D( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding )
Conv2D
Conv2D( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding, const Conv2D::Attrs & attrs )
Knoten
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const
Öffentliche statische Funktionen
Datei Format
Attrs DataFormat( StringPiece x )
Dilatationen
Attrs Dilations( const gtl::ArraySlice< int > & x )
ExplicitPaddings
Attrs ExplicitPaddings( const gtl::ArraySlice< int > & x )
UseCudnnOnGpu
Attrs UseCudnnOnGpu( bool x )