Keras的“嵌入”层如何工作?
需要了解Keras库中“嵌入”层的工作方式。我在Python中执行以下代码 import numpy as np from keras.models import Sequential from keras.layers import Embedding model = Sequential() model.add(Embedding(5, 2, input_length=5)) input_array = np.random.randint(5, size=(1, 5)) model.compile('rmsprop', 'mse') output_array = model.predict(input_array) 它给出以下输出 input_array = [[4 1 3 3 3]] output_array = [[[ 0.03126476 0.00527241] [-0.02369716 -0.02856163] [ 0.0055749 0.01492429] [ 0.0055749 0.01492429] …