Giter Club home page Giter Club logo

keras_metrics's Introduction

Keras_Metrics

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)

How to use

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])

Related Formula

  • 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.

keras_metrics's People

Contributors

wenyanger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.