<p>As per this <a href="https://arxiv.org/pdf/1404.2188.pdf" rel="noreferrer">paper</a>, k-Max Pooling is a pooling operation that is a generalisation of the max pooling over the time dimension used in the Max-TDNN sentence model
and different from the local max pooling operations applied in a convolutional network for object recognition (LeCun et al., 1998).</p>

<p><a href="https://i.stack.imgur.com/oshJY.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/oshJY.jpg" alt="enter image description here"></a></p>

<p>The k-max pooling operation makes it possible
to pool the k most active features in p that may be
a number of positions apart; it preserves the order
of the features, but is insensitive to their specific
positions.</p>

<p>There are few resources which show how to implement it in tensorflow or keras:</p>

<ul>
<li><a href="https://stackoverflow.com/questions/51299181/how-to-implement-k-max-pooling-in-tensorflow-or-keras">How to implement K-Max pooling in Tensorflow or Keras?</a></li>
<li><a href="https://github.com/keras-team/keras/issues/373" rel="noreferrer">https://github.com/keras-team/keras/issues/373</a></li>
<li><a href="https://homes.cs.washington.edu/~yjzhang/notebooks/2016/2016-3-10%20-%20New%20Pooling%20Layers.html" rel="noreferrer">New Pooling Layers For Varying-Length Convolutional Networks</a></li>
</ul>
What is K Max Pooling? How to implement it in Keras?
<p>I have to add a k-max pooling layer in CNN model to detect fake reviews. Please can you let me know how to implement it using keras.</p>

<p>I searched the internet but I got no good resources.</p>