使用VAE模型时,输入数据为(12,1)形状。
然后我想将温度和湿度数据作为变量来改进模型。
'''
1. My data format
'''
sample_df.head()
area year month id usage
1 1 2009 1 11111 6670
2 1 2009 2 11111 5746
'''
2. After Pivoting
'''
sample_df.head()
id 1M 2M 3M... 9M 10M 11M 12M
11111 6670.00 5746.00 4608.00... 4962.00 6987.00 8051.00 8325.00
...
'''
3. My Initial model Structure
'''
Layer (type) Output Shape Param # Connected to
==================================================================================================
encoder_input (InputLayer) (None, 12, 1) 0
__________________________________________________________________________________________________
conv1d_1 (Conv1D) (None, 10, 4) 16 encoder_input[0][0]
__________________________________________________________________________________________________
batch_normalization_1 (BatchNor (None, 10, 4) 16 conv1d_1[0][0]
__________________________________________________________________________________________________
leaky_re_lu_1 (LeakyReLU) (None, 10, 4) 0 batch_normalization_1[0][0]
__________________________________________________________________________________________________
conv1d_2 (Conv1D) (None, 8, 8) 104 leaky_re_lu_1[0][0]
__________________________________________________________________________________________________
batch_normalization_2 (BatchNor (None, 8, 8) 32 conv1d_2[0][0]
__________________________________________________________________________________________________
leaky_re_lu_2 (LeakyReLU) (None, 8, 8) 0 batch_normalization_2[0][0]
__________________________________________________________________________________________________
conv1d_3 (Conv1D) (None, 6, 16) 400 leaky_re_lu_2[0][0]
__________________________________________________________________________________________________
batch_normalization_3 (BatchNor (None, 6, 16) 64 conv1d_3[0][0]
__________________________________________________________________________________________________
leaky_re_lu_3 (LeakyReLU) (None, 6, 16) 0 batch_normalization_3[0][0]
__________________________________________________________________________________________________
conv1d_4 (Conv1D) (None, 6, 1) 17 leaky_re_lu_3[0][0]
__________________________________________________________________________________________________
batch_normalization_4 (BatchNor (None, 6, 1) 4 conv1d_4[0][0]
__________________________________________________________________________________________________
leaky_re_lu_4 (LeakyReLU) (None, 6, 1) 0 batch_normalization_4[0][0]
__________________________________________________________________________________________________
flatten_1 (Flatten) (None, 6) 0 leaky_re_lu_4[0][0]
__________________________________________________________________________________________________
z_mean (Dense) (None, 2) 14 flatten_1[0][0]
__________________________________________________________________________________________________
z_log_var (Dense) (None, 2) 14 flatten_1[0][0]
__________________________________________________________________________________________________
z (Lambda) (None, 2) 0 z_mean[0][0]
z_log_var[0][0]
__________________________________________________________________________________________________
decoder (Model) (None, 12, 1) 777 z[0][0]
==================================================================================================
对于每个ID,每个月都有温度和湿度数据,如何在VAE模型中将这些数据输入到输入数据中?