Atten_Deep_MIL
Atten_Deep_MIL copied to clipboard
feeding the learnt embedding as input to a new CNN
Thanks a lot for the code.
I would like to learn an embedding from the MIL attention network and feed this as input to another CNN.
Essentially, I would like to chop off the last sigmoid right after computing the sum
x = K.sum(x, axis=0, keepdims=True)
in the custom_layers.py
However, when I compute the sum, the dimension gets reduced to (1,27,27,3) from (?,27,27,3) which is not accpeted by the conv2d layer which throws an error:
ValueError: Input 0 is incompatible with layer conv2d_34: expected ndim=4, found ndim=3
How can I get rid of this problem?
Will a reshapping or expanding dimensions help?
Kind regards,
I increased the dimensions of the final FC layer to a value higher than 1, say 256 and it works