main.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:keras-timeseries-prediction 作者: gcarq 项目源码 文件源码
def build_model(look_back: int, batch_size: int=1) -> Sequential:
    """
    The function builds a keras Sequential model
    :param look_back: number of previous time steps as int
    :param batch_size: batch_size as int, defaults to 1
    :return: keras Sequential model
    """
    model = Sequential()
    model.add(LSTM(64,
                   activation='relu',
                   batch_input_shape=(batch_size, look_back, 1),
                   stateful=True,
                   return_sequences=False))
    model.add(Dense(1, activation='linear'))
    model.compile(loss='mean_squared_error', optimizer='adam')
    return model
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号