Concatenation of two models

Hello, I’ve trained two neural networks (both are ULMFiT) with two different fine-tunes, first on them is prepared for binary classification and second for multi-label multi classification.
Is there possibility to somehow concatenate outputs from encoders of them and add binary classification on top?

Best regards

So do you mean something that takes the output of them as input?

Yes. I’ve made something similar to this:

But instead tabular network, I’ve inserted my AWD_LSTM. And in the end I’ve met another issue - I don’t know how to predict single example with .predict(example), because I’ve got this error:
AttributeError: ‘ConcatDataset’ object has no attribute ‘set_item’

1 Like