为ltsm构造numpy数据(示例)

时间:2018-05-30 10:17:41

标签: python numpy neural-network deep-learning lstm

我在理解如何为不同模型准备数据时遇到问题:

  1. 一对多
  2. 多对一
  3. 多对多(A)
  4. 多对多(B)
  5. enter image description here

    这是以这种方式思考的正确方法。形状编号无关紧要,与图片上的形状编号不匹配。我只是想了解背后的逻辑。:

    import numpy as np
    
    
    #1. one to many
    # X for input y for output
    
    X = np.ones([10,1,5])
    y = np.zeros([10,3]) #3 represnts size of output vector
    
    #2. many to one
    
    X = np.ones([10,5,5])
    y = np.zeros([10,1])
    
    #3. many to many
    
    X = np.ones([10,5,5])
    y = np.zeros([10,5])  
    
    # in this case cell should be different than y. It must be bigger to shift some data
    
    #4. many to many
    
    X = np.ones([10,5,5])
    y = np.zeros([10,5])
    
    # in this case cell is the same shape as y
    

0 个答案:

没有答案