如何在TFLearn中将多个数据行用作单个输入?

时间:2017-04-05 14:02:46

标签: python tensorflow tflearn

我正在尝试使用TFLearn(或TensorFlow直接)重建嘈杂(如谐波)信号。我的输入有168列要转换为84输出。我想将每个列对视为一个像素。我不必去实时,所以我想使用多行输入来生成单个输出。我想我需要至少20行输入(两侧各10个)来计算单行输出。如何正确地重塑我的数据?例如。见评论:

def learn1(data, answers): 
    # data.shape == 5000x168, answers.shape = 5003x84
    network = tflearn.input_data(shape=[None, 20, 84, 2])
    ... set up 2D convolutional network ...
    model = tflearn.DNN(network)

    X = # data reshaped into overlapping groups of 20 -- what goes here?
    Y = # I don't have any labels. What goes here?
    Y_test = # what goes here?
    model.fit(X, Y, n_epoch=50, shuffle=False, 
        validation_set=(answers, Y_test), batch_size=10)

我可以随意生成测试数据。谢谢你的帮助。

0 个答案:

没有答案