Guest User

Untitled

a guest
Jun 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. vocab_size = 1000
  2. src_txt_length = 500
  3. sum_txt_length = 100
  4. inputs = Input(shape=(src_txt_length,))
  5.  
  6. encoder1 = Embedding(vocab_size, 128)(inputs)
  7. encoder2 = LSTM(128)(encoder1)
  8. encoder3 = RepeatVector(sum_txt_length)(encoder2)
  9.  
  10. decoder1 = LSTM(128, return_sequences=True)(encoder3)
  11. outputs = TimeDistributed(Dense(100, activation='softmax'))(decoder1)
  12.  
  13. model = Model(inputs=inputs, outputs=outputs)
  14. model.compile(loss='categorical_crossentropy', optimizer='adam')
  15.  
  16. hist = model.fit(x_train, y_train, verbose=1, validation_data=(x_test, y_test), batch_size=batch_size, epochs=5)
  17.  
  18. ValueError: Error when checking target: expected time_distributed_27 to have 3 dimensions, but got array with shape (28500, 100)
Add Comment
Please, Sign In to add comment