keras-language-modeling icon indicating copy to clipboard operation
keras-language-modeling copied to clipboard

Output shape of the similarity merge layer is still incorrect

Open guxd opened this issue 8 years ago • 1 comments

I use the latest version and check the similarity part of the model, i.e., qa_model = merge([question_output, answer_output], mode=similarity, output_shape=lambda x: x[:-1],name='similarity') When I invoke qa_model.summary(), here is the screen output: insuranceqa similarity

capture

The last layer (similarity) should have an output shape of (None, 1) but is (None, 200). I use the default 'cos' mode of Keras, it is (None,1). Also, the program doesn't work. It has nan loss.

guxd avatar Jun 30 '16 02:06 guxd

I fixed this just now. I think the output shape should just always be (None, 1). The thing is, I don't think it made a difference. I think the nan loss could be coming from somewhere else? Not sure. Let me know if this fixed it.

codekansas avatar Aug 02 '16 12:08 codekansas