tensorflow:: ops:: Conv2D

#include <nn_ops.h>

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

תַקצִיר

בהינתן טנזור קלט בעל צורה [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] .

טיעונים:

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

מאפיינים אופציונליים (ראה Attrs ):

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

החזרות:

  • Output : טנזור 4-ממדי. סדר המימדים נקבע על ידי הערך של 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(
  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
)

צוֹמֶת

::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
)