NLP - Text Generation
You wrote this code to train an RNN text generator but get a shape mismatch error:
What is the main issue causing the error?
model = Sequential() model.add(Embedding(input_dim=10000, output_dim=64, input_length=15)) model.add(SimpleRNN(128)) model.add(Dense(10000, activation='softmax')) X = np.random.randint(0, 10000, (64, 15)) y = np.random.randint(0, 10000, (64, 15)) # target labels model.compile(loss='sparse_categorical_crossentropy', optimizer='adam') model.fit(X, y, epochs=5)
What is the main issue causing the error?
