Python keras.regularizers.md() Examples

The following are code examples for showing how to use keras.regularizers.md(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: keras_extension   Author: k1414st   File: mac.py    MIT License 6 votes vote down vote up
def call(self, inputs, training=None):

        c, r, m, msa = inputs[0], inputs[1], inputs[2], inputs[3]

        mi = K.bias_add(K.dot(K.concatenate([r, m], axis=-1),
                              self.mi_kernel),
                        self.mi_bias)

        md = K.bias_add(K.dot(msa, self.mdsa_kernel) +
                        K.dot(mi, self.mdi_kernel),
                        self.md_bias)
        cd = K.bias_add(K.dot(c, self.cd_kernel),
                        self.cd_bias)
        mi = self.forget_activation(cd) * m + \
            self.forget_activation(1-cd) * md
        return mi 
Example 2
Project: keras_extension   Author: k1414st   File: mac.py    MIT License 6 votes vote down vote up
def call(self, inputs, training=None):

        c, r, m, msa = inputs[0], inputs[1], inputs[2], inputs[3]

        mi = K.bias_add(K.dot(K.concatenate([r, m], axis=-1),
                              self.mi_kernel),
                        self.mi_bias)

        md = K.bias_add(K.dot(msa, self.mdsa_kernel) +
                        K.dot(mi, self.mdi_kernel),
                        self.md_bias)
        cd = K.bias_add(K.dot(c, self.cd_kernel),
                        self.cd_bias)
        mi = self.forget_activation(cd) * m + \
            self.forget_activation(1-cd) * md
        return mi