Google I/O में ट्यूनिंग के लिए धन्यवाद। मांग पर सभी सत्र देखें मांग पर देखें

टेंसरफ़्लो :: ऑप्स :: Conv2D

#include <nn_ops.h>

4-डी input और filter टेंसर को दिए गए 2-डी कनविक्शन की गणना करता है।

सारांश

आकार के एक इनपुट टेंसर को देखते हुए [batch, in_height, in_width, in_channels] और आकार का एक फ़िल्टर / कर्नेल टेंसर [filter_height, filter_width, in_channels, out_channels] , यह ऑप्‍शन निम्‍न कार्य करता है:

  1. फ़िल्टर को आकार के साथ 2-D मैट्रिक्स में [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 के मान के अनुसार की data_format , विवरण के लिए नीचे देखें।
  • फिल्टर: आकार का एक 4 डी टेन्सर [filter_height, filter_width, in_channels, out_channels]
  • strides: लंबाई का 1-D टेन्सर 4. input प्रत्येक आयाम के लिए स्लाइडिंग विंडो का स्ट्राइड। आयाम क्रम data_format के मान से निर्धारित होता है, विवरण के लिए नीचे देखें।
  • पैडिंग: उपयोग करने के लिए पैडिंग एल्गोरिथ्म का प्रकार।

वैकल्पिक विशेषताएँ ( Attrs देखें):

  • clar_paddings: यदि padding "EXPLICIT" , तो स्पष्ट पैडिंग राशियों की सूची। Ith आयाम के लिए, आयाम से पहले और बाद में सम्मिलित किए गए पैडिंग की मात्रा explicit_paddings[2 * i] और explicit_paddings[2 * i + 1] , क्रमशः। तो padding नहीं है "EXPLICIT" , explicit_paddings रिक्त होना ही चाहिए।
  • data_format: इनपुट और आउटपुट डेटा के डेटा प्रारूप को निर्दिष्ट करें। डिफ़ॉल्ट प्रारूप "एनएचडब्ल्यूसी" के साथ, डेटा के क्रम में संग्रहीत किया जाता है: [बैच, ऊंचाई, चौड़ाई, चैनल]। वैकल्पिक रूप से, प्रारूप "एनसीएचडब्ल्यू" हो सकता है: [बैच, चैनल, ऊंचाई, चौड़ाई] का डेटा भंडारण क्रम।
  • फैलाव: लंबाई का 1-डी टेन्सर 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)

संरचनाएं

टेंसरफ़्लो :: ऑप्स :: Conv2D :: एट्र्स

वैकल्पिक विशेषता 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
)

स्पष्ट करना

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

UseCudnnOnGpu

Attrs UseCudnnOnGpu(
  bool x
)