在RNN训练示例中,我注意到输入数据和目标数据都是三维数组,需要定义输入和输出之间的时间步长延迟。
input_seqs = np.zeros((num_batches, num_time_steps, batch_size), dtype=floatX)
target_seqs = np.zeros((num_batches, num_time_steps, batch_size), dtype=floatX)
target_seqs[0:-1, :] = input_seqs[1:, :]
我想为RNN训练加载自定义数据 - 输入向量= 1,输出向量= 1,time_steps = 1(参见附件data1a.csv)。重塑在这里不起作用。有谁可以说明如何做到这一点?
train = pd.read_csv("data1a.csv")
input = np.array(train.values[:][:, 1:2], dtype=np.float32)
input_seqs = ???
target_seqs = ???
谢谢!
数据链接: links data1a.csv
我只是对它有所了解,但不知道如何继续:
train = pd.read_csv("data1a.csv")
dataset = np.array(train.values[:][:, 1:2], dtype=np.float32)
def batch():
inputs = np.zeros((batch_size, time_steps, dataset.shape[1]), 'f')
outputs = np.zeros((batch_size, time_steps, dataset.shape[1]), 'f')
for b in range(batch_size):
i = np.random.randint(len(dataset) - time_steps - 1)
inputs[b] = dataset[i:i+time_steps]
outputs[b] = dataset[i+1:i+1+time_steps]
return [inputs, outputs]
下一步是什么?
input_seqs = ???
target_seqs = ???