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