Relative Content

Tag Archive for keras

How to train a keras model with a single output using two different metrics with differnt target values

The question is complete in the title. For the context I am training an alignment model using a CTC loss. In this case the CTC loss requires the as target value the sequence of labels (without label duration). Additionally I’d like to use a metric that evaluates the probability distribution of the model using the sequence of labels including repetitions (label durations). So the model has one output but tow different target values.

Model Accuracy Not Changing

I’m making a model with Keras that tries to predict if a person has Parkinson’s disease based on a drawing of a spiral using this dataset. However, my model is limited to a max train accuracy of 72.22% and a max test accuracy of 66.67% for some reason no matter how many more epochs or layers I add.

keras custom loss with for loop raises exception only when run_eagerly is False

I wrote a simple custom loss function in keras (below here) which uses a for loop .
This function is very stupid, I could avoid the for loop but I wrote it as exercise for me.
I get an exception unless I use model.run_eagerly=True.
I don’t understand why I get the exception and why I get it only when model.run_eagerly is False.