utils.py 文件源码

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

项目:DeepAnomaly 作者: adiyoss 项目源码 文件源码
def store_prediction_and_ground_truth(model):
    input_size = 1
    maxlen = 140
    batch_size = 32

    db = read_data('../data/ECG5000_TEST_PHASE_1_CONTINUOUS_SIGNAL_1.pkl')
    X = create_sequences(db[:-140], win_size=maxlen, step=maxlen)
    X = np.reshape(X, (X.shape[0], X.shape[1], input_size))
    Y = create_sequences(db[140:], win_size=maxlen, step=maxlen).flatten()

    prediction = model.predict(X, batch_size, verbose=1)
    prediction = prediction.flatten()
    with open('../data/ECG5000_TRAIN_PHASE_2_CONTINUOUS_SIGNAL_1.pkl', 'wb') as f:
        pickle.dump(np.stack((Y, prediction)), f)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号