I’m trying to do the optional week 3 lab. When I get to the model building stage:
model = tf.keras.Sequential([
tf.keras.layers.Embedding(vocab_size+1, embedding_dim, input_length=max_length, weights=[embeddings_matrix], trainable=False),
tf.keras.layers.Conv1D(128, 5, activation=‘relu’),
tf.keras.layers.GlobalAveragePooling1D(),
tf.keras.layers.Dense(6, activation=‘relu’),
tf.keras.layers.Dense(1, activation=‘sigmoid’)
])
model.compile(loss=‘binary_crossentropy’, optimizer=‘adam’, metrics=[‘accuracy’])
model.summary()
num_epochs = 50
history = model.fit(training_sequences, training_labels, epochs=num_epochs, validation_data=(test_sequences, test_labels), verbose=2)
print(“Training Complete”)
My input data isn’t the right shape. It says expected= (None, 16) , but which input needs to be changed?
How to get it to that shape?