Guest User

Untitled

a guest
Mar 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import keras.backend as K
  2.  
  3. def cross-entropy(yTrue,yPred):
  4. return -K.sum(yTrue*K.log(yPred))
  5.  
  6. model.fit(input,input_matrix,epochs=1)
  7. input.shape # shape=(nb_tweets,100)
  8. # ex. tweet = "if you have" input = [11, 14, 21, 4, 26, 19, 7, 4, 26, 18, 19]
  9.  
  10. input_matrix.shape # shape=(nb_tweets,100,28) each character is encoded using one-hot encoding
  11. # ex. a = (0,1,0,0,0,....0)
Add Comment
Please, Sign In to add comment