Spec-Zone.ru › TensorFlow C++ 2.3

tensorflow::ops::DepthwiseConv2dNative

#include <nn_ops.h>

Вычисляет двумерную свертку по глубине, используя 4-мерные input и filter тензоры.

Краткое описание

Исходный тензор имеет форму [batch, in_height, in_width, in_channels], а тензор фильтра/ядра имеет форму [filter_height, filter_width, in_channels, channel_multiplier], содержащий in_channels свёрточных фильтров глубиной 1. depthwise_conv2d применяет разный фильтр к каждому входному каналу (расширяя от 1 канала до channel_multiplier каналов для каждого), а затем конкатенирует результаты вместе. Таким образом, выходной тензор имеет 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]

Необходимо, чтобы strides[0] = strides[3] = 1. В наиболее распространённом случае одинаковых горизонтальных и вертикальных шагов, strides = [1, stride, stride, 1].

Аргументы:

  • scope: Объект Scope
  • strides: 1-мерный массив длиной 4. Шаг скользящего окна для каждого измерения input.
  • padding: Тип алгоритма заполнения.

Дополнительные атрибуты (см. Attrs):

  • data_format: Указывает формат данных для входных и выходных данных. По умолчанию, с форматом "NHWC", данные хранятся в порядке: [batch, высота, ширина, каналы]. В качестве альтернативы можно использовать формат "NCHW", порядок хранения данных: [batch, каналы, высота, ширина].
  • dilations: 1-мерный тензор длиной 4. Фактор расширения для каждого измерения input. Если установлено значение k > 1, между каждым элементом фильтра в этом измерении будет k-1 пропущенных ячеек. Порядок измерения определяется значением data_format, см. подробности выше. Расширение в измерениях партии и глубины должно быть равно 1.

Возвращаемые значения:

  • Output: Выходной тензор.
Конструкторы и деструкторы
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)
Публичные атрибуты
operation
Operation
output
::tensorflow::Output
Публичные функции
node() const
::tensorflow::Node *
operator::tensorflow::Input() const
operator::tensorflow::Output() const
Публичные статические функции
DataFormat(StringPiece x)
Attrs
Dilations(const gtl::ArraySlice< int > & x)
Attrs
ExplicitPaddings(const gtl::ArraySlice< int > & x)
Attrs
Структуры
tensorflow::ops::DepthwiseConv2dNative::Attrs

Дополнительные атрибуты установки для DepthwiseConv2dNative.

Публичные атрибуты

operation

Operation operation

output

::tensorflow::Output output

Публичные функции

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
)

node

::tensorflow::Node * node() const 

operator::tensorflow::Input

operator::tensorflow::Input() const 

operator::tensorflow::Output

operator::tensorflow::Output() const 

Публичные статические функции

DataFormat

Attrs DataFormat(
  StringPiece x
)

Dilations

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

ExplicitPaddings

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

© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/depthwise-conv2d-native

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API