CNTK
CNTK copied to clipboard
Is there anyway to implement MaxPooling for an sequence since ReduceMax does not support for sequence?
If you want a global max pooling, there is now a sequence.reduce_max.
If you want max pooling over a windows of 3 tokens/frames then you can do the following:
p = C.sequence.past_value(x)
n = C.sequence.future_value(x)
window = C.splice(p, x, n, axis=C.Axis.new_leading_axis())
result = C.reshape(C.reduce_max(window, axis=0), (x.shape))
Here window is a sequence of 3 x d tensors where d was the shape of x. The result is just taking a maximum over 3 values the previous, the current one and the next one and reshaping to the shape of x.
You can easily extend this code to support larger windows.
Feel free to reopen this thread if you have followup questions.