【发布时间】:2021-05-18 18:09:13
【问题描述】:
我正在为我的工作目的训练一个自动编码器神经网络。但是我正在接受
图像 numpy 数组数据集作为输入(总样本 16110),并希望使用以下 autoencoder.fit 命令将数据集拆分为训练集和测试集。此外,在训练网络时,它就像在 12856 个样本上训练一样,在 3254 个样本上进行验证。
但是,我需要将训练和测试数据保存到单独的文件中。我该怎么做?
es=EarlyStopping(monitor='val_loss',mode='min',verbose=1,patience=5)
mc=ModelCheckpoint('best_model.h5',monitor='val_loss',mode='min',save_best_only=True)
history = autoencoder.fit(dataNoise,dataNoise, epochs=30, batch_size=256, shuffle=256,callbacks=[es,mc], validation_split = 0.2)
【问题讨论】:
标签: python-3.x tensorflow keras