在caffe prototxt文件中. TRAIN和TEST阶段做什么? [英] in caffe prototxt file. what does the TRAIN and TEST phase do?

查看:264
本文介绍了在caffe prototxt文件中. TRAIN和TEST阶段做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是咖啡新手.谢谢你们!

I'm new to caffe. thank you guys!

https://github.com/BVLC中/caffe/blob/master/src/caffe/proto/caffe.proto

我看到1个未注释的枚举可变阶段.它有2个选项TRAIN和TEST.

I saw 1 uncommented enum variable phase. it has 2 option TRAIN and TEST.

enum Phase {
   TRAIN = 0;
   TEST = 1;
}

它们是如何工作的?我最近看到一个模型也具有这两个阶段. .prototxt文件如下所示:

how did they work? I saw a model recently has this 2 phase too. the .prototxt file looks like:

name: "CIFAR10_full"
layer {
  name: "cifar"
  type: "Data"
  top: "data"
  top: "label"
  data_param {
    source: "CIFAR-10/cifar10_train_lmdb"
    backend: LMDB
    batch_size: 200
  }
  transform_param {
    mirror: true
  }
  include: { phase: TRAIN }
}
layer {
  name: "cifar"
  type: "Data"
  top: "data"
  top: "label"
  data_param {
    source: "CIFAR-10/cifar10_test_lmdb"
    backend: LMDB
    batch_size: 100
  }
  transform_param {
    mirror: false
  }
  include: { phase: TEST }
}

我可以从训练阶段切换到测试阶段吗?开关在哪里?

can I switch from TRAIN phase to TEST phase? where is the switch?

推荐答案

在训练(即执行$CAFFE_ROOT/tools/caffe train [...])期间,caffe可以在训练阶段和测试阶段之间交替:即,在训练阶段中,参数会更改,而在测试阶段,参数是固定的,并且模型仅运行前馈示例以估计模型的当前性能.
使用两个不同的数据集进行训练和测试是很自然的,这就是为什么您使用不同的phase值.

during training (i.e., execution of $CAFFE_ROOT/tools/caffe train [...]) caffe can alternate between training phases, and testing phases: that is, during training phase parameters are changed, while in the test phase, the parameters are fixed and the model only runs feed forward examples to estimate the current performance of the model.
It is quite natural to use two different data sets for training and testing, and this is why you use the different phase values.

您可以在此处了解更多有关训练/测试迭代的信息.

You can read more about the train/test iterations here.

这篇关于在caffe prototxt文件中. TRAIN和TEST阶段做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆