when i test shuffle true, accuracy is 97%, but shuffle false 27%.

211 views
Skip to first unread message

YiKo

unread,
Mar 18, 2017, 10:07:47 PM3/18/17
to Caffe Users
what is difference with test shuffle true or false

i just changed the shuffle parameter as below

layer {
    name: "data"
    type: "ImageData"
    top: "data"
    top: "label"
    include {
        phase: TEST
    }

    image_data_param {
        source: "..imagedata.txt"
        batch_size: 100
        shuffle: true -> false
    }
}

why result is difference?


and,, i have a another problem..
i tested with 10 classes data.
when i tested all the data at once. -> the accuracy(top1) is over 90%
but when i test each class separately (first time label-0 only, next-1 only, ...)
top-1 accuracy is under the 40% every class..
I'm confusing. why the result is difference?

mahdi yed

unread,
Mar 20, 2017, 10:18:50 AM3/20/17
to Caffe Users
Hi, for the second question i can't say what's the probleme exactly but the first question i would say that this is a normal behavior i mean let's take a s an example the mnist base so when y do shuffle
the batch will contain differt numbers (2,1,8,4,5,1,2,3,1,9,7,6....) so your network will learn the representation of all the classes each patch (or almost all) but if u don't use shuffle your net will lear a single representation each time for example your net will learn how to represent only the class "1" for n iteration then when it is done with learning "1" it will change all weights again to learn the representation of the second class  for  example "2" then "3" ..... and go on

YiKo

unread,
Mar 21, 2017, 10:12:09 PM3/21/17
to Caffe Users
thank you for answering, mahdi yed

i'm sorry that i worte the text not clearly...
i mean, i train the network with shuffle=true,
and
case#1 : test with shuffle = true => accuracy is 97%
case#2 : test with shuffle = false => accuracy is 27%
(both of case, trained with shuffle = true)

I don't know what is diffrence...

and the second question is meaning that...

i have 10 list of test set.
test_0.txt <-- this file include just label '0'
test_1.txt <-- this file include just label '1'
...
test_9.txt <-- this file include just label '9'

test_all.txt <-- this file is made by (test_0.txt + test_1.txt + test_2.txt + .... + test_9.txt)

when i test with test_all.txt => accuracy is over 90%
but, when i test with test_0.txt ~ test_9.txt separately => accuracy is under 40% all...

if you have any idea for this problem, please help me.

2017년 3월 20일 월요일 오후 11시 18분 50초 UTC+9, mahdi yed 님의 말:

nara19...@gmail.com

unread,
Dec 4, 2017, 4:07:13 AM12/4/17
to Caffe Users
Did you set "use_global_stats" equals to “true” in the BN layer when you test your network with "shuffle=false" option? I think it might be the reason for it.

在 2017年3月19日星期日 UTC+8上午10:07:47,YiKo写道:
Reply all
Reply to author
Forward
0 new messages