Class: Chainer::Functions::Pooling::Pooling2D

Inherits:
Chainer::FunctionNode show all
Defined in:
lib/chainer/functions/pooling/pooling_2d.rb

Overview

Base class of pooling function over a set of 2d planes

Direct Known Subclasses

AveragePooling2D, MaxPooling2D

Instance Attribute Summary collapse

Attributes inherited from Chainer::FunctionNode

#inputs, #outputs, #rank

Instance Method Summary collapse

Methods inherited from Chainer::FunctionNode

#apply, #backward, #backward_accumulate, #forward, #forward_cpu, #get_retained_inputs, #get_retained_outputs, #label, #output_data, #retain_inputs, #retain_outputs, #unchain

Constructor Details

#initialize(ksize, stride: nil, pad: 0, cover_all: true) ⇒ Pooling2D

Returns a new instance of Pooling2D.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/chainer/functions/pooling/pooling_2d.rb', line 8

def initialize(ksize, stride: nil, pad: 0, cover_all: true)
  if stride.nil?
    stride = ksize
  end

  @kh, @kw = ksize.is_a?(::Array) ? ksize : [ksize, ksize]
  @sy, @sx = stride.is_a?(::Array) ? stride : [stride, stride]
  @ph, @pw = pad.is_a?(::Array) ? pad: [pad, pad]

  @cover_all = cover_all
end

Instance Attribute Details

#cover_allObject (readonly)

Returns the value of attribute cover_all.



6
7
8
# File 'lib/chainer/functions/pooling/pooling_2d.rb', line 6

def cover_all
  @cover_all
end

#khObject (readonly)

Returns the value of attribute kh.



6
7
8
# File 'lib/chainer/functions/pooling/pooling_2d.rb', line 6

def kh
  @kh
end

#kwObject (readonly)

Returns the value of attribute kw.



6
7
8
# File 'lib/chainer/functions/pooling/pooling_2d.rb', line 6

def kw
  @kw
end

#phObject (readonly)

Returns the value of attribute ph.



6
7
8
# File 'lib/chainer/functions/pooling/pooling_2d.rb', line 6

def ph
  @ph
end

#pwObject (readonly)

Returns the value of attribute pw.



6
7
8
# File 'lib/chainer/functions/pooling/pooling_2d.rb', line 6

def pw
  @pw
end

#sxObject (readonly)

Returns the value of attribute sx.



6
7
8
# File 'lib/chainer/functions/pooling/pooling_2d.rb', line 6

def sx
  @sx
end

#syObject (readonly)

Returns the value of attribute sy.



6
7
8
# File 'lib/chainer/functions/pooling/pooling_2d.rb', line 6

def sy
  @sy
end