简体   繁体   English

卷积神经网络的训练和测试

[英]Training and testing in convolutional neural networks

I would like to know at what stage testing dataset is used CNNs?我想知道在什么阶段使用 CNN 测试数据集? Is it used after completion of each batch or one epoch during training or is it used after completion of all the epochs?它是在训练期间完成每批或一个时期后使用,还是在完成所有时期后使用? I am a bit confused as to how these two processes run together?我对这两个进程如何一起运行感到有些困惑? Similarly gradient updation is done after each batch or each epoch?类似的梯度更新是在每个批次或每个时期之后完成的吗?

model.fit_generator(
aug.flow(x_train, y_train, batch_size=BATCH_SIZE),
validation_data=(x_test, y_test),
steps_per_epoch=len(x_train) // BATCH_SIZE,
epochs=EPOCHS, verbose=1, callbacks = callbacks)

From fit_generator it is only clear that images are loaded batch by batch onto memory.从 fit_generator 可以清楚地看出,图像是批量加载到 memory 上的。

Keras is using validation datasets in the end of every epoch (if you didn't change validation_freq in the fit function). Keras 在每个 epoch 结束时使用验证数据集(如果您没有在fit函数中更改validation_freq )。 Each epoch your model trains on the whole train dataset and later evaluates itself on the validation dataset每个时期,您的 model 都会在整个火车数据集上进行训练,然后在验证数据集上进行自我评估

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM