added check for multitask models - #10
Conversation
visze
left a comment
There was a problem hiding this comment.
please check this again.
Also if working we should include this in the variantsFromSequence wrapper!
| satMutSequence.getSequence())) | ||
| # predict | ||
| prediction = model.predict(np.array(X)) | ||
| if isinstance(prediction, list): |
There was a problem hiding this comment.
can you give an example whats the differenc ebetween the output? maybe a test? normally the output of the predict function is a numpy array not a list (see api https://www.tensorflow.org/api_docs/python/tf/keras/Model#predict). So this will be always false?
maybe the shape has 3 dimensions now?
E.g. you predict 2 inputs with 4 tasks the youtput will be
prediction = np.array([[0,1,0.5,1],[0,1,0,0.5]])Also I was wondering if the
There was a problem hiding this comment.
I had a look at my code, and I think I know why I the output is a list.
For training multiple separate tasks, I train shared convolutional layers and then train dense layers for each task separately. The way I pass the output layers to Model() is in a list that is dynamically generated based on the tasks.
model = Model(inputs=inputs, outputs=output_list)I assume that predict stores the resulting arrays in a list of the same length as the list passed to Model()
There was a problem hiding this comment.
is it also possible to pass an np.array? Can you check this? Maybe then the output might be different and the is instance list will not work...
|
anything here? |
Added a small check for DL models with multiple separate outputs. Checks if output is a list (of arrays) instead of an array.