tensorflow emb

import tensorflow as tf

import numpy as np 

model = tf.keras.Sequential()
model.add(tf.keras.layers.Embedding(10, 1, input_length=5))

input_array = np.random.randint(10, size=(2, 5))
print(input_array)
model.compile('rmsprop', 'mse')
output_array = model.predict(input_array)
print(output_array)

  

posted @ 2021-03-26 11:59  通杀  阅读(30)  评论(0编辑  收藏  举报