Beispiel #1
0
 def call(self, x, mask=None):
     h = K.dot(x, self.W1)
     if self.use_bias:
         h = K.bias_add(h, self.b1)
     if self.activation is not None:
         h = self.activation(h)
     y = K.dot(h, self.W2)
     if self.use_bias:
         y = K.bias_add(y, self.b2)
     return y
Beispiel #2
0
 def call(self, inputs, mask=None, **kwargs):
     inputs, embeddings = inputs
     outputs = K.bias_add(K.dot(inputs, K.transpose(embeddings)), self.bias)
     return keras.activations.softmax(outputs)