Performs fractional average pooling on the input. Fractional average pooling is similar to Fractional max pooling in the pooling region generation step. The only difference is that after pooling regions are generated, a mean operation is performed instead of a max operation in each pooling region.
(scope *Scope, value tf.Output, pooling_ratio []float32, optional ...FractionalAvgPoolAttr)
| 9636 | // |
| 9637 | // Returns output tensor after fractional avg pooling.row pooling sequence, needed to calculate gradient.column pooling sequence, needed to calculate gradient. |
| 9638 | func FractionalAvgPool(scope *Scope, value tf.Output, pooling_ratio []float32, optional ...FractionalAvgPoolAttr) (output tf.Output, row_pooling_sequence tf.Output, col_pooling_sequence tf.Output) { |
| 9639 | if scope.Err() != nil { |
| 9640 | return |
| 9641 | } |
| 9642 | attrs := map[string]interface{}{"pooling_ratio": pooling_ratio} |
| 9643 | for _, a := range optional { |
| 9644 | a(attrs) |
| 9645 | } |
| 9646 | opspec := tf.OpSpec{ |
| 9647 | Type: "FractionalAvgPool", |
| 9648 | Input: []tf.Input{ |
| 9649 | value, |
| 9650 | }, |
| 9651 | Attrs: attrs, |
| 9652 | } |
| 9653 | op := scope.AddOperation(opspec) |
| 9654 | return op.Output(0), op.Output(1), op.Output(2) |
| 9655 | } |
| 9656 | |
| 9657 | // FractionalMaxPoolGradAttr is an optional argument to FractionalMaxPoolGrad. |
| 9658 | type FractionalMaxPoolGradAttr func(optionalAttr) |