Atten_Deep_MIL icon indicating copy to clipboard operation
Atten_Deep_MIL copied to clipboard

feeding the learnt embedding as input to a new CNN

Open czarmanu opened this issue 5 years ago • 1 comments

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,

czarmanu avatar Oct 23 '19 17:10 czarmanu

I increased the dimensions of the final FC layer to a value higher than 1, say 256 and it works

czarmanu avatar Oct 25 '19 21:10 czarmanu