class_docstr: An encoder that pools over embeddings, as described in
  https://arxiv.org/abs/1611.02344. The encoder supports optional positions
  embeddings and a configurable pooling window.
  
  Params:
    dropout_keep_prob: Dropout keep probability applied to the embeddings.
    pooling_fn: The 1-d pooling function to use, e.g.
      `tensorflow.layers.average_pooling1d`.
    pool_size: The pooling window, passed as `pool_size` to
      the pooling function.
    strides: The stride during pooling, passed as `strides`
      the pooling function.
    position_embeddings.enable: If true, add position embeddings to the
      inputs before pooling.
    position_embeddings.combiner_fn: Function used to combine the
      position embeddings with the inputs. For example, `tensorflow.add`.
    position_embeddings.num_positions: Size of the position embedding matrix.
      This should be set to the maximum sequence length of the inputs.
class_docstr_tok: ["An","encoder","that","pools","over","embeddings",",","as","described","in","https",":","\/\/arxiv.org\/abs\/1611.02344",".","The","encoder","supports","optional","positions","embeddings","and","a","configurable","pooling","window",".","Params",":","dropout_keep_prob",":","Dropout","keep","probability","applied","to","the","embeddings",".","pooling_fn",":","The","1-d","pooling","function","to","use",",","e.g",".","`","tensorflow.layers.average_pooling1d","`",".","pool_size",":","The","pooling","window",",","passed","as","`","pool_size","`","to","the","pooling","function",".","strides",":","The","stride","during","pooling",",","passed","as","`","strides","`","the","pooling","function",".","position_embeddings.enable",":","If","true",",","add","position","embeddings","to","the","inputs","before","pooling",".","position_embeddings.combiner_fn",":","Function","used","to","combine","the","position","embeddings","with","the","inputs",".","For","example",",","`","tensorflow.add","`",".","position_embeddings.num_positions",":","Size","of","the","position","embedding","matrix",".","This","should","be","set","to","the","maximum","sequence","length","of","the","inputs","."]
code: def __init__(self, params, mode, name="pooling_encoder"):
      super(PoolingEncoder, self).__init__(params, mode, name)
      self._pooling_fn = locate(self.params["pooling_fn"])
      self._combiner_fn = locate(
          self.params["position_embeddings.combiner_fn"]
      )
  
file_path: seq2seq/seq2seq/encoders/pooling_encoder.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from pydoc import locate
  import numpy
  import tensorflow
  from seq2seq.encoders.encoder import Encoder, EncoderOutput
label_desc: Use image node_id 1 to create a new PoolingEncoder object from inherited base classes: Encoder with example: obj = PoolingEncoder(params, mode, name)