test_iter test_interval max_iter ?

2,071 views
Skip to first unread message

lhc5...@163.com

unread,
May 9, 2016, 4:30:37 AM5/9/16
to Caffe Users
the relationship between test_iter,test_interval,max_iter with train batch_size and test batch_size ?

Jan

unread,
May 9, 2016, 5:54:12 AM5/9/16
to Caffe Users
It would be nice of you to write full sentences, and formulate your question a bit more precisely than just throwing some words at us.

The batch_size defines how many samples are fed through the network at once, followed by a weight-update usually.

max_iter is the number of batches (in the context of solving also called "iterations" in caffe) to feed to the network for training. These are not necessarily different from each other: if your data source is at the end it will just rewind to the beginning to provide more samples.

test_interval is the number of iterations, after which a test instance is run. For the test instance test_iter batches are processed by the network and an average accuracy and/or loss value is computed by the solver for this test instance. After that the training continues.


Jan

lhc5...@163.com

unread,
May 9, 2016, 6:43:41 AM5/9/16
to Caffe Users
assume training batch_size=50,testing batch_size=40;test_iter=10;test_interval=30,max_iter=1000;then
In the training phase,one interation means one training batch_size?
the max_iter means 1000 trainning batch_size?
when in the first test_interval, it means in the test phase,one
interation means one testing batch_size?
it needs 10 interations?


in addition,How to set up  the training batch_size and test_interval,and testing batch_size and test_iter?
在 2016年5月9日星期一 UTC+8下午4:30:37,lhc5...@163.com写道:

Jan

unread,
May 9, 2016, 7:17:54 AM5/9/16
to Caffe Users


Am Montag, 9. Mai 2016 12:43:41 UTC+2 schrieb lhc5...@163.com:
assume training batch_size=50,testing batch_size=40;test_iter=10;test_interval=30,max_iter=1000;then
In the training phase,one interation means one training batch_size?
 
Yes. 
 
the max_iter means 1000 trainning batch_size?

Yes, there are 1000 batches fed through the network in the training phase.
 
when in the first test_interval, it means in the test phase,one interation means one testing batch_size?
it needs 10 interations?


Yes. 
 
in addition,How to set up  the training batch_size and test_interval,and testing batch_size and test_iter?

Not sure what you're asking here. It completely depends on your setup, and there are no real go-to rules to set these parameters up. There are some restrictions however: For a large batch_size you need a lot of memory, which may or may not (depending on the GPU you own) be a problem for you. A larger batch_size is generally more efficient (in terms of memory transactions and processing performance, not necessarily in learning itself).

Jan

lhc5...@163.com

unread,
May 9, 2016, 7:52:21 AM5/9/16
to Caffe Users
I have a question to ask you :

I want to do a three classification ,I have 1200 training samples,300 testing samples,I using like MNIST network lenet_train_test.prototxt,or like cifar 10 network cifar10_quick_train_test.prototxt ,no matter I modify the paramters in the solver,but the accuracy always  0.336 or other like this ,it means the networks failture,
that's why?

I0509 19:17:21.296618  5095 solver.cpp:341] Iteration 200, Testing net (#0)
I0509 19:17:22.217316  5095 solver.cpp:409]     Test net output #0: accuracy = 0.336667
I0509 19:17:22.217378  5095 solver.cpp:409]     Test net output #1: loss = 3.11041 (* 1 = 3.11041 loss)
I0509 19:17:22.280432  5095 solver.cpp:237] Iteration 200, loss = 1.10292
I0509 19:17:22.280500  5095 solver.cpp:253]     Train net output #0: loss = 1.10292 (* 1 = 1.10292 loss)
I0509 19:17:22.280519  5095 sgd_solver.cpp:106] Iteration 200, lr = 0.000894427
I0509 19:17:24.548373  5095 solver.cpp:237] Iteration 210, loss = 1.09893
I0509 19:17:24.548434  5095 solver.cpp:253]     Train net output #0: loss = 1.09893 (* 1 = 1.09893 loss)
I0509 19:17:24.548452  5095 sgd_solver.cpp:106] Iteration 210, lr = 0.00088882
I0509 19:17:26.816138  5095 solver.cpp:237] Iteration 220, loss = 1.10086
I0509 19:17:26.816195  5095 solver.cpp:253]     Train net output #0: loss = 1.10086 (* 1 = 1.10086 loss)
I0509 19:17:26.816216  5095 sgd_solver.cpp:106] Iteration 220, lr = 0.000883176
I0509 19:17:29.083833  5095 solver.cpp:237] Iteration 230, loss = 1.10251
I0509 19:17:29.083889  5095 solver.cpp:253]     Train net output #0: loss = 1.10251 (* 1 = 1.10251 loss)
I0509 19:17:29.083912  5095 sgd_solver.cpp:106] Iteration 230, lr = 0.000877496
I0509 19:17:31.351832  5095 solver.cpp:237] Iteration 240, loss = 1.09761
I0509 19:17:31.351889  5095 solver.cpp:253]     Train net output #0: loss = 1.09761 (* 1 = 1.09761 loss)
I0509 19:17:31.351912  5095 sgd_solver.cpp:106] Iteration 240, lr = 0.00087178
I0509 19:17:33.393201  5095 solver.cpp:341] Iteration 250, Testing net (#0)
I0509 19:17:34.476779  5095 solver.cpp:409]     Test net output #0: accuracy = 0.336667
I0509 19:17:34.476836  5095 solver.cpp:409]     Test net output #1: loss = 3.11043 (* 1 = 3.11043 loss)
I0509 19:17:34.539875  5095 solver.cpp:237] Iteration 250, loss = 1.09814
I0509 19:17:34.539939  5095 solver.cpp:253]     Train net output #0: loss = 1.09814 (* 1 = 1.09814 loss)

can you give me some advice?
thanks

在 2016年5月9日星期一 UTC+8下午4:30:37,lhc5...@163.com写道:
the relationship between test_iter,test_interval,max_iter with train batch_size and test batch_size ?

mhaoy...@163.com

unread,
Aug 15, 2017, 6:28:29 AM8/15/17
to Caffe Users
你试着把学习率降低10倍,或者你看看是不是训练集有错误分类的。我只知道这么多。
try to lower learning rate , or check your trainning set whether there exists wrong sample, wrong sample means it should not be there , it should be other class.

在 2016年5月9日星期一 UTC+8下午7:52:21,huancheng liu写道:
Reply all
Reply to author
Forward
0 new messages