Some Metric Implementation in Keras (Such as Pearsons Correlation Coefficient, MRE)
Now Including:
- Pearsons Correlation Coefficient
- Mean Relative Error
- Jaccard Loss (Derivable, can be used as LOSS for training in Keras)
- Jaccard Index
- Dice Similarity Coefficient (aka. DSC)
Just an example ~
inp = Input(shape=(timesteps, 1))
gru = Bidirectional(GRU(500, return_sequences=True))(inp)
max1 = GlobalMaxPool1D()(gru_1)
att1 = Attention()(gru_1)
cont1 = keras.layers.concatenate([max1, att1])
out = Dense(1, activation='relu')(cont1)
opt = keras.optimizers.Adam(lr=0.002, beta_1=0.9, beta_2=0.9, epsilon=1e-08, amsgrad=True)
model = Model(inputs=inp, outputs=out)
model.compile(loss='mse',
optimizer=opt,
metrics=['mse', pearson_r, mre])
- Pearsons Correlation Coefficient
- Jaccard Loss
- Dice Similarity Coefficient
- Mean Relative Error
See here
Sayin C, Ertunc H M, Hosoz M, et al. Performance and exhaust emissions of a gasoline engine using artificial neural network[J]. Applied Thermal Engineering, 2007, 27(1):46-54.