问题
I am trying to find the similarity of documents. Referring to this github repo: https://github.com/s4sarath/Deep-Learning-Projects/blob/master/variational_text_inference/model_evaluation.ipynb
When I run this code:
batch_size = 100
H_20_grp_nws = []
batch_data = A.get_batch(batch_size)
batch_id = 0
for batch_ in batch_data:
batch_id += 1
collected_data = [chunks for chunks in batch_]
batch_xs , mask_xs , mask_negative = A._bag_of_words(collected_data)
feed_dict = {vae.X: batch_xs , vae.dynamic_batch_size:batch_xs.shape[0],
vae.MASK:mask_xs}
h_batch = feed_dict= feed_dict
H_20_grp_nws.extend(h_batch)
H_20_grp_nws = np.array(H_20_grp_nws) from sklearn import manifold tsne = manifold.TSNE(n_components=2, init='pca', random_state=0) %time H_tsne = tsne.fit_transform(H_20_grp_nws) ########### Converting to tsne
I get an error: 'ValueError: setting an array element with a sequence'
can someone help me here?
来源:https://stackoverflow.com/questions/61406994/how-to-handle-errors-in-arrays-and-sequence