aliran tensor:: operasi:: DepthwiseConv2dNative

#include <nn_ops.h>

Menghitung konvolusi kedalaman 2-D dengan input 4-D dan tensor filter .

Ringkasan

Diberikan tensor masukan berbentuk [batch, in_height, in_width, in_channels] dan tensor filter / kernel berbentuk [filter_height, filter_width, in_channels, channel_multiplier] , yang berisi filter konvolusional in_channels dengan kedalaman 1, depthwise_conv2d menerapkan filter berbeda ke setiap saluran masukan (memperluas dari 1 saluran menjadi channel_multiplier untuk masing-masing saluran), lalu menggabungkan hasilnya. Jadi, outputnya memiliki saluran in_channels * channel_multiplier .

for k in 0..in_channels-1
  for q in 0..channel_multiplier-1
    output[b, i, j, k * channel_multiplier + q] =
      sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] *
                        filter[di, dj, k, q]

Harus memiliki strides[0] = strides[3] = 1 . Untuk kasus paling umum dari langkah horizontal dan simpul yang sama, strides = [1, stride, stride, 1] .

Argumen:

  • ruang lingkup: Objek Lingkup
  • langkah: 1-D panjang 4. Langkah jendela geser untuk setiap dimensi input .
  • padding: Jenis algoritma padding yang akan digunakan.

Atribut opsional (lihat Attrs ):

  • data_format: Menentukan format data input dan output data. Dengan format default "NHWC", data disimpan dalam urutan: [batch, tinggi, lebar, saluran]. Alternatifnya, formatnya bisa berupa "NCHW", urutan penyimpanan data: [batch, saluran, tinggi, lebar].
  • dilatasi: tensor 1-D dengan panjang 4. Faktor dilatasi untuk setiap dimensi input . Jika diatur ke k > 1, akan ada k-1 sel yang dilewati di antara setiap elemen filter pada dimensi tersebut. Urutan dimensi ditentukan oleh nilai data_format , lihat di atas untuk detailnya. Pelebaran dalam dimensi batch dan kedalaman harus 1.

Pengembalian:

Konstruktor dan Destruktor

DepthwiseConv2dNative (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding)
DepthwiseConv2dNative (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding, const DepthwiseConv2dNative::Attrs & attrs)

Atribut publik

operation
output

Fungsi publik

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

Fungsi statis publik

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

Struktur

tensorflow:: ops:: DepthwiseConv2dNative:: Attrs

Penyetel atribut opsional untuk DepthwiseConv2dNative .

Atribut publik

operasi

Operation operation

keluaran

::tensorflow::Output output

Fungsi publik

DepthwiseConv2dNative

 DepthwiseConv2dNative(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input filter,
  const gtl::ArraySlice< int > & strides,
  StringPiece padding
)

DepthwiseConv2dNative

 DepthwiseConv2dNative(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input filter,
  const gtl::ArraySlice< int > & strides,
  StringPiece padding,
  const DepthwiseConv2dNative::Attrs & attrs
)

simpul

::tensorflow::Node * node() const 

operator::tensorflow::Masukan

 operator::tensorflow::Input() const 

operator::tensorflow::Keluaran

 operator::tensorflow::Output() const 

Fungsi statis publik

Format data

Attrs DataFormat(
  StringPiece x
)

Pelebaran

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