텐서플로우:: 작전:: Conv2D

#include <nn_ops.h>

4차원 inputfilter 텐서가 주어지면 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 "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)

구조체

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

사용CudnnOnGpu

Attrs UseCudnnOnGpu(
  bool x
)