tensorflow:: ops:: FractionalMaxPool
#include <nn_ops.h>入力に対して分数最大プーリングを実行します。
まとめ
分数最大プーリングは、通常の最大プーリングとは少し異なります。通常の最大プーリングでは、入力セットをN×N個の小さな部分集合(多くの場合2×2)に分割し、それぞれの最大値を取って、整数Nの係数で縮小します。分数最大プーリングは、「分数」という言葉からも想像できるように、全体の縮小率Nが整数である必要はありません。
プーリング領域のサイズはランダムに生成されますが、かなり均一です。例えば、高さ方向の寸法と、プール境界となる行のリストに対する制約を見てみましょう。
まず、以下を定義します。
- input_row_length : the number of rows from the input set
- output_row_length : which will be smaller than the input
- alpha = input_row_length / output_row_length : our reduction ratio
- K = floor(alpha)
- row_pooling_sequence : this is the result list of pool boundary rows
そして、row_pooling_sequence は以下を満たす必要があります。
- a[0] = 0 : 数列の最初の値は 0 です
- a[end] = input_row_length : the last value of the sequence is the size
- K <= (a[i+1] - a[i]) <= K+1 : all intervals are K or K+1 size
- length(row_pooling_sequence) = output_row_length+1
For more details on fractional max pooling, see this paper: Benjamin Graham, Fractional Max-Pooling
議論:
- スコープ:スコープオブジェクト
- value: 4-D with shape
[batch, height, width, channels]. - pooling_ratio:
valueの各次元のプーリング比率。現在、行と列の次元のみをサポートしており、1.0 以上である必要があります。たとえば、有効なプーリング比率は [1.0, 1.44, 1.73, 1.0] のようになります。バッチとチャネルの次元ではプーリングが許可されていないため、最初と最後の要素は 1.0 でなければなりません。1.44 と 1.73 は、それぞれ高さと幅の次元のプーリング比率です。
オプション属性( Attrs参照):
- pseudo_random: Trueに設定すると、プーリングシーケンスが擬似乱数的に生成されます。それ以外の場合は、ランダムに生成されます。擬似乱数とランダムの違いについては、Benjamin Grahamの論文「Fractional Max-Pooling」を参照してください。
- overlapping: When set to True, it means when pooling, the values at the boundary of adjacent pooling cells are used by both cells. For example:
index 0 1 2 3 4
value 20 5 16 3 7
If the pooling sequence is [0, 2, 4], then 16, at index 2 will be used twice. The result would be [20, 16] for fractional max pooling.
- deterministic: Trueに設定すると、計算グラフ内のFractionalMaxPoolノードを反復処理する際に、固定のプーリング領域が使用されます。主に単体テストでFractionalMaxPoolを決定論的にするために使用されます。
- seed: seedまたはseed2のいずれかがゼロ以外の値に設定されている場合、乱数生成器は指定されたシード値で初期化されます。それ以外の場合は、ランダムなシード値で初期化されます。
- seed2: シードの衝突を避けるための2つ目のシード。
返品:
-
Outputoutput: output tensor after fractional max pooling. -
Outputrow_pooling_sequence: row pooling sequence, needed to calculate gradient. -
Outputcol_pooling_sequence: column pooling sequence, needed to calculate gradient.
コンストラクターとデストラクタ | |
|---|---|
FractionalMaxPool (const :: tensorflow::Scope & scope, :: tensorflow::Input value, const gtl::ArraySlice< float > & pooling_ratio) | |
FractionalMaxPool (const :: tensorflow::Scope & scope, :: tensorflow::Input value, const gtl::ArraySlice< float > & pooling_ratio, const FractionalMaxPool::Attrs & attrs) |
公開属性 | |
|---|---|
col_pooling_sequence | |
operation | |
output | |
row_pooling_sequence | |
パブリック静的関数 | |
|---|---|
Deterministic (bool x) | |
Overlapping (bool x) | |
PseudoRandom (bool x) | |
Seed (int64 x) | |
Seed2 (int64 x) | |
構造 | |
|---|---|
| tensorflow:: ops:: FractionalMaxPool:: Attrs | Optional attribute setters for FractionalMaxPool . |
公開属性
col_pooling_sequence
::tensorflow::Output col_pooling_sequence
手術
Operation operation
出力
::tensorflow::Output output
行プーリングシーケンス
::tensorflow::Output row_pooling_sequence
公的機能
FractionalMaxPool
FractionalMaxPool( const ::tensorflow::Scope & scope, ::tensorflow::Input value, const gtl::ArraySlice< float > & pooling_ratio )
FractionalMaxPool
FractionalMaxPool( const ::tensorflow::Scope & scope, ::tensorflow::Input value, const gtl::ArraySlice< float > & pooling_ratio, const FractionalMaxPool::Attrs & attrs )
パブリック静的関数
決定論的
Attrs Deterministic( bool x )
重複
Attrs Overlapping( bool x )
擬似乱数
Attrs PseudoRandom( bool x )
シード
Attrs Seed( int64 x )
シード2
Attrs Seed2( int64 x )