RMSE/ RMSLE loss function in Keras : <p>I try to participate in my first Kaggle competition where <code>RMSLE</code> is given as the required loss function. For I have found nothing how to implement this <code>loss function</code> I tried to settle for <code>RMSE</code>. I know this was part of <code>Keras</code> in the past, is there any way to use it in the latest version, maybe with a customized function via <code>backend</code>?</p>

<p>This is the NN I designed:</p>

<pre><code>from keras.models import Sequential
from keras.layers.core import Dense , Dropout
from keras import regularizers

model = Sequential()
model.add(Dense(units = 128, kernel_initializer = "uniform", activation = "relu", input_dim = 28,activity_regularizer = regularizers.l2(0.01)))
model.add(Dropout(rate = 0.2))
model.add(Dense(units = 128, kernel_initializer = "uniform", activation = "relu"))
model.add(Dropout(rate = 0.2))
model.add(Dense(units = 1, kernel_initializer = "uniform", activation = "relu"))
model.compile(optimizer = "rmsprop", loss = "root_mean_squared_error")#, metrics =["accuracy"])

model.fit(train_set, label_log, batch_size = 32, epochs = 50, validation_split = 0.15)
</code></pre>

<p>I tried a customized <code>root_mean_squared_error</code> function I found on GitHub but for all I know the syntax is not what is required. I think the <code>y_true</code> and the <code>y_pred</code> would have to be defined before passed to the return but I have no idea how exactly, I just started with programming in python and I am really not that good in math...</p>

<pre><code>from keras import backend as K

def root_mean_squared_error(y_true, y_pred):
        return K.sqrt(K.mean(K.square(y_pred - y_true), axis=-1)) 
</code></pre>

<p>I receive the following error with this function: </p>

<pre><code>ValueError: ('Unknown loss function', ':root_mean_squared_error')
</code></pre>

<p>Thanks for your ideas, I appreciate every help!</p>
