cnn 预测过程代码_在Keras中实现因果CNN以进行多元时间序列预测

This question is a followup to my previous question here: Multi-feature causal CNN - Keras implementation, however, there are numerous things that are unclear to me that I think it warrants a new ques...
摘要由CSDN通过智能技术生成

This question is a followup to my previous question here: Multi-feature causal CNN - Keras implementation, however, there are numerous things that are unclear to me that I think it warrants a new question. The model in question here has been built according to the accepted answer in the post mentioned above.

I am trying to apply a Causal CNN model on multivariate time-series data of 10 sequences with 5 features.

lookback, features = 10, 5

What should filters and kernel be set to?

What is the effect of filters and kernel on the network?

Are these just an arbitrary number - i.e. number of neurons in ANN layer?

Or will they have an effect on how the net interprets the time-steps?

What should dilations be set to?

Is this just an arbitrary number or does this represent the lookback of the model?

filters = 32

kernel = 5

dilations = 5

dilation_rates = [2 ** i for i in range(dilations)]

model = Sequential()

model.add(InputLayer(input_shape=(lookback, features)))

model.add(Reshape(target_shape=(features, lookback, 1), input_shape=(lookback, features)))

According to the previously mentioned answer, the input needs to be reshaped according to the following logic:

After Reshape 5 input features are now treated as the temporal layer for the TimeDistributed layer

When Conv1D is applied to each input feature, it thinks the shape of the layer is (10, 1)

with the default "channels_last", therefore...

10 time-steps is the temporal dimension

1 is the "channel", the new location for the feature maps

# Add causal layers

for dilation_rate in dilation_rates:

model.add(TimeDistributed(Conv1D(filters=filters,

kernel_size=kernel,

padding='causal',

dilation_rate=dilation_rate,

activation='elu')))

According to the mentioned answer, the model needs to be reshaped, according to the following logic:

Stack feature maps on top of each other so each

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值