What I learned today: you can't use if-conditionals in a Keras custom loss function. I managed to come with a solution...
All the operations in the custom loss function need to be vectorised, so an if-conditional breaks it and throws an exception. The solution is to create Boolean vectors corresponding to each condition, turn their types into float (must be float), multiply each Boolean by the corresponding loss function and sum.
Example:
@hdkarlsen Welcome! If your psychometrics tastes involve Rasch models, you may be interested in this (although I'm afraid I'm more of a Python person who uses R grudgingly because of its inevitability...)
https://elk.zone/mastodon.online/@ThatMarkElliott/110658139034723518
So here's a link to my post over on Post.news describing our two papers – too long for the character limit here. If you are interested in Rasch models, psychometrics or assessment theory generally, they might be of interest to you... https://post.news/@/markelliott/2S7rBjq9cZqGa8ZcnUewOAOIeF4 #Rasch #Psychometrics #Assessment
A reference to a discussion and debunking of Rees-Mogg's claims, for those who are not familiar with that particular grubby episode (which, for the avoidance of doubt, I am not suggesting was the actions of Nazis, but rather another example of an attempt to whitewash history by minimising atrocities):
http://gladstonediaries.blogspot.com/2019/02/british-concentration-camps-response-to.html
This is a fascinating and illuminating read, with implications well beyond Wikipedia – think of all the careful narrative framing and dubious claims that you see on social media and hear from politicians – even supposedly mainstream politicians, such as Jacob Rees-Mogg, who attempted to minimise the British use of concentration camps during the Boer War by falsely claiming that the death rate in those camps was the same as the death rate in Glasgow at the time.
If you need to be delighted by something this morning, I present the tree goats of Morocco.
I was driving near Essaouira the first time I saw this and literally slammed on my brakes because I thought I was suddenly hallucinating. But then you learn how common it is and after a day or two it's, oh, yeah, more goats in trees.