neural network - How to understand Keras 1D Convolution input shape and filter -


i spent time understand input_shape = (batch_size, steps, input_dim) in keras conv1d, cannot make progress far.

to more specific, have 2 datasets.

dataset-1: solar energy production of 24 hours of each day in 1 year, size of dataset (364,24), days in row , consumption in columns.

example of 2 days:

day-1: [0   0   0   0   0   0   0   1.611   5.791   8.229   9.907   9.649   8.401   6.266   4.728   2.231   0.306   0.013   0   0   0   0   0   0]  day-2: [0   0   0   0   0   0   0   1.732   5.839   9.909   12.593  14.242  12.744  9.596   5.808   2.019   0.241   0   0   0   0   0   0   0]` 

what want cnn using 6 days' data predict 7th day. reason, divided dataset so:

xtrain = dataset[0:6,0:24] # takes 24 hour of 6 days ytrain = dataset[6,0:24] # takes 24 hour of 7th day xtest = dataset[1:7,0:24] # takes 24 hours 6 days (day2 day7) predict day 8 

to compatible keras' input shape, reshaped training data follows:

xtrain = xtrain.reshape(6,1,24) 

number of samples: 6, time dimension: 1, input_dimension:24

is correct thinking?

model.add(conv1d(**filters?**,kernel_size=4,activation='relu', **input_shape=?**))  

in second dataset:

training data: xtrain: day-1 hour-1 hour-24, day-2 hour-1 hour-24 ... day-6 hour-1 hour-24 ytrain: day-7 hour-1 hour-24 

i have created new dataset takes 24 hours of day in rows , 7 days in columns, (8616,7) matrix.

hour-1 day-1, day-2 ... day-7 hour-2 day-1, day-2 ... day-7 ... hour-24 day-1, day-2 ... day-7 ... hour-1 day-2, day-3 ... day-8 hour-2 day-2, day-3 ... day-8 ... hour-24 day-2, day-3 ... day-8 ... hour-1 day-359, day-360 ... day-365 hour-2 day-359, day-360 ... day-365 ... hour-24 day-359, day-360 ... day-365 

keras code:

xtrain = dataset[0:24,0:6] # takes 24 hour 6 days ytrain = dataset[24:48,6] # takes 24 hour of 7th day xtest = dataset[24:48,0:6] # takes 24 hours 6 days (day2 day7) predict day 7  xtrain = xtrain[newaxis,:, :] ytrain = ytrain.reshape(1,24) 

i don't understand filters , input_shape should be.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -