From 0fea3e8f79f838c45d5bd228af1782983d5fc69d Mon Sep 17 00:00:00 2001 From: Bright Chang <75425626@qq.com> Date: Thu, 27 Dec 2018 17:12:44 +0800 Subject: [PATCH] changes are needed since tensorflow has changed! mul->multiply add logits and labels to sigmoid cross entropy function --- model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model.py b/model.py index d59f46b..bebe445 100644 --- a/model.py +++ b/model.py @@ -119,13 +119,13 @@ def __init__(self, model_params, num_emoji, embeddings_array, use_embeddings=Tru v_col = tf.nn.dropout(v_col, (1 - model_params.dropout)) # Calculate the predicted score, a.k.a. dot product (here) - self.score = tf.reduce_sum(tf.mul(v_row, v_col), 1) + self.score = tf.reduce_sum(tf.multiply(v_row, v_col), 1) # Probability of match self.prob = tf.sigmoid(self.score) # Calculate the cross-entropy loss - self.loss = tf.nn.sigmoid_cross_entropy_with_logits(self.score, self.y) + self.loss = tf.nn.sigmoid_cross_entropy_with_logits(logits=self.score, labels=self.y) # train the model using the appropriate parameters def train(self, kb, hooks, session):