텐서플로우:: 연산:: 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가 같은 가장 일반적인 경우 strides = [1, stride, stride, 1] .

논거:

  • 범위: Scope 객체
  • 입력: 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 "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)

구조

텐서플로우:: 연산:: 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
)