We are implementing a GlobalAveragePooling on top of a masking layer causing Not Supported error.
We saw this solution but unfortunately this solution cant fit our situation.
We use a custom embedding algorithm, causing some samples to be all zeros, thus we can not mask with zero vectors
e.g. self.model.add(Masking(mask_value=-9999., input_shape=(max_length, nr_in)))
And some layers afterwards
avged = GlobalAveragePooling1D()(result, mask=max_len)
maxed = GlobalMaxPooling1D()(result, mask=max_len)
merged = merge([avged, maxed])
Is there a way to use the global average and max pooling methods with masks of this sort?
Thanks!
We are using Tensorflow 0.12.0 and keras 1.2.2