我正在尝试基于以下仓库构建一个生成的RNN-LSTM模型:https://github.com/flawnson/Molecule_generating_RNN/blob/master/final_model.py
当尝试将输入X调整为循环模型的输入格式[样本,时间步长,特征]时,它说我无法对其进行调整。
enter n_chars = len(raw_text)
n_vocab = len(unique_chars)
print ("Total number of characters in the file is: ", n_chars)
# Preparing datasets by matching the dataset lengths (dataX will be the SMILES strings and dataY will be individual characters in the SMILE string)
seq_length = 137
dataX = []
dataY = []
for i in range (0, n_chars - seq_length, 1):
seq_in = raw_text[i:i + seq_length]
seq_out = raw_text[i + seq_length]
dataX.append([char_to_int[char] for char in seq_in])
dataX.append(char_to_int[seq_out])
n_patterns = len(dataX)
X = np.reshape (dataX, (n_patterns, seq_length, 1)