זרימת טנסור :: אופ :: Conv2D

#include <nn_ops.h>

מחשב קונבולציה דו-ממדית הניתנת טנזורי input filter 4-D.

סיכום

בהתחשב בטנזור קלט של צורה [batch, in_height, in_width, in_channels] מסנן / גרעין בצורת [filter_height, filter_width, in_channels, out_channels] , פעולה זו מבצעת את הפעולות הבאות:

  1. משטח את המסנן למטריצה ​​דו-ממדית עם צורה [filter_height * filter_width * in_channels, output_channels] .
  2. מחלץ טלאי תמונה ממקור הקלט ליצירת טנסור וירטואלי של צורה [batch, out_height, out_width, filter_height * filter_width * in_channels] .
  3. עבור כל תיקון, מכפיל ימינה את מטריצת המסנן ואת וקטור תיקון התמונה.

בפירוט, עם פורמט NHWC המוגדר כברירת מחדל,

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]

חייבים להיות strides[0] = strides[3] = 1 . במקרה הנפוץ ביותר של אותם צעדים אופקיים וקודקודים, strides = [1, stride, stride, 1] .

טענות:

  • היקף: אובייקט Scope
  • קלט: טנסור 4-D. סדר המימדים מתפרש על פי ערך data_format , ראה להלן לפרטים.
  • פילטר: טנסור 4-D של צורה [filter_height, filter_width, in_channels, out_channels]
  • צעדים: אורך טנסור 1-D 4. צעד חלון ההזזה לכל מימד input . סדר המידות נקבע על פי הערך של data_format , ראה להלן לפרטים.
  • ריפוד: סוג אלגוריתם הריפוד לשימוש.

תכונות אופציונליות (ראה Attrs ):

  • explicit_paddings: אם padding הוא "EXPLICIT" , רשימת סכומי הריפוד המפורשים. עבור הממד ה- IH, כמות הריפודים שהוכנסה לפני המאפיין ואחריו היא explicit_paddings[2 * i] ו- explicit_paddings[2 * i + 1] בהתאמה. אם padding אינו "EXPLICIT" , "EXPLICIT" explicit_paddings חייבים להיות ריקים.
  • data_format: ציין את פורמט הנתונים של נתוני הקלט והפלט. בפורמט ברירת המחדל "NHWC", הנתונים נשמרים לפי הסדר של: [אצווה, גובה, רוחב, ערוצים]. לחלופין, הפורמט יכול להיות "NCHW", סדר אחסון הנתונים של: [אצווה, ערוצים, גובה, רוחב].
  • התרחבות: אורך טנסור 1-D 4. גורם ההתרחבות לכל מימד input . אם מוגדר כ- k> 1, יהיו תאי דילוג בין k-1 בין כל אלמנט המסנן בממד זה. סדר המימדים נקבע על פי הערך של data_format , ראה לעיל לפרטים. התרחבות במידת האצווה והעומק חייבת להיות 1.

החזרות:

  • Output : טנסור 4-D. סדר המידות נקבע על פי הערך של data_format , ראה להלן לפרטים.

קונסטרוקטורים ומשחתנים

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)

תכונות ציבוריות

operation
output

פונקציות ציבוריות

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

פונקציות סטטיות ציבוריות

DataFormat (StringPiece x)
Dilations (const gtl::ArraySlice< int > & x)
ExplicitPaddings (const gtl::ArraySlice< int > & x)
UseCudnnOnGpu (bool x)

סטרוקטורים

tensorflow :: ops :: Conv2D :: Attrs

קובעי תכונות אופציונליים עבור Conv2D .

תכונות ציבוריות

מבצע

Operation operation

תְפוּקָה

::tensorflow::Output output

פונקציות ציבוריות

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
)

צוֹמֶת

::tensorflow::Node * node() const 

אופרטור :: זרימת טנסור :: קלט

 operator::tensorflow::Input() const 

אופרטור :: זרימת טנסור :: פלט

 operator::tensorflow::Output() const 

פונקציות סטטיות ציבוריות

פורמט נתונים

Attrs DataFormat(
  StringPiece x
)

התרחבות

Attrs Dilations(
  const gtl::ArraySlice< int > & x
)

ExplicitPaddings

Attrs ExplicitPaddings(
  const gtl::ArraySlice< int > & x
)

UseCudnnOnGpu

Attrs UseCudnnOnGpu(
  bool x
)