tensorflow:: ops:: 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. フィルタを形状[filter_height * filter_width * in_channels, output_channels]の 2 次元行列に平坦化します。
  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の値に従って解釈されます。詳細は下記を参照してください。
  • フィルター: [filter_height, filter_width, in_channels, out_channels]の形状を持つ 4 次元テンソル
  • strides: 長さ4の1次元テンソル。 inputの各次元におけるスライディングウィンドウのストライド。次元の順序はdata_formatの値によって決まります。詳細は下記を参照してください。
  • padding: 使用するパディングアルゴリズムの種類。

オプション属性( Attrs参照):

  • explicit_paddings: paddingが"EXPLICIT"の場合、明示的なパディング量のリスト。i番目の次元について、その次元の前後に挿入されるパディング量は、それぞれexplicit_paddings[2 * i]とexplicit_paddings[2 * i + 1]です。padding padding "EXPLICIT"でない場合、 explicit_paddings空でなければなりません。
  • data_format: 入力データと出力データのデータ形式を指定します。デフォルトの形式「NHWC」では、データは[バッチ、高さ、幅、チャネル]の順で格納されます。あるいは、形式を「NCHW」に指定することもできます。この場合、データの格納順序は[バッチ、チャネル、高さ、幅]となります。
  • 膨張: 長さ 4 の 1 次元テンソル。 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

 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

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 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
)