NLP - Sequence Models for NLP
Consider this code snippet using TensorFlow Keras:
What will be the shape of
from tensorflow.keras.models import Sequential from tensorflow.keras.layers import LSTM, Bidirectional, Dense model = Sequential() model.add(Bidirectional(LSTM(10, return_sequences=False), input_shape=(5, 8))) model.add(Dense(1, activation='sigmoid')) model.compile(optimizer='adam', loss='binary_crossentropy') import numpy as np x = np.random.random((2, 5, 8)) pred = model.predict(x) print(pred.shape)
What will be the shape of
pred?