Tensorflow.js tf.layers.averagePooling1d() Function
The tf.layers.averagePooling1d() function is used to apply the average pooling operation on data.
Input shape: [batchSize, inLength, channels]
Output shape: [batchSize, pooledLength, channels]
Parameters: It accepts the args object which can have the following properties:
- args: It is an object type value that can accept the following values –
- poolSize: It is the size of the pooling window. This should be an integer.
- strides: The period for sampling the pooled values. Defaults to poolSize if null.
- padding: This specifies how to fill in data that are not an integral multiple of poolSize
- inputShape: If this property is set, it will be utilized to construct an input layer that will be inserted before this layer.
- batchInputShape: If this property is set, an input layer will be created and inserted before this layer.
- batchSize: If batchInputShape isn’t supplied and inputShape is, batchSize is utilized to build the batchInputShape.
- dtype: It is the kind of data type for this layer. float32 is the default value. This parameter applies exclusively to input layers.
- name: This is the layer’s name and is of string type.
- trainable: If the weights of this layer may be changed by fit. True is the default value.
- weights: The layer’s initial weight values.
- inputDType: It is the legacy support. It will not be used with new code.
Returns: It returns an object (AveragePooling1D).
Tensor [[[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]]
Tensor [[[2.5, 3.5, 4.5 ], [8.5, 9.5, 10.5]]]