tensorflow:: אופס:: Conv2D

#include <nn_ops.h>

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

סיכום

בהינתן טנסור קלט של צורה [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: אובייקט 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" , רשימת סכומי הריפוד המפורשים. עבור הממד ה-ith, כמות הריפוד שהוכנסה לפני ואחרי הממד היא explicit_paddings[2 * i] ו- explicit_paddings[2 * i + 1] , בהתאמה. אם padding אינו "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 

מפעיל::tensorflow::קלט

 operator::tensorflow::Input() const 

אופרטור::tensorflow::פלט

 operator::tensorflow::Output() const 

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

פורמט נתונים

Attrs DataFormat(
  StringPiece x
)

הרחבות

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

ריפודים מפורשים

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

השתמש בCudnnOnGpu

Attrs UseCudnnOnGpu(
  bool x
)