Spec-Zone.ru › TensorFlow C++

tensorflow::ops::DepthwiseConv2dNative

#include <nn_ops.h>

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

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

Для входного тензора формы [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: одномерный тензор длины 4. Шаг скользящего окна для каждого измерения input.
  • padding: тип используемого алгоритма дополнения.

Необязательные атрибуты (см. Attrs):

  • data_format: задаёт формат данных на входе и выходе. В формате по умолчанию "NHWC" данные хранятся в следующем порядке: [пакет, высота, ширина, каналы]. Также можно использовать формат "NCHW", в котором данные хранятся в следующем порядке: [пакет, каналы, высота, ширина].
  • dilations: одномерный тензор длины 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
)

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

Spec-Zone.ru

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