poweic/libdnn

Have a problem when training cnn

DennisLiu94 opened this issue · 2 comments

Sorry to bother. I have a little problem on training a cnn.

It works perfectly on my computer when I try to train a normal network. But when I try to train a cnn, the in-sample and out-of-sample accuracy are both always 2.92%. They never change.

I used these command to train my cnn:

./nn-init --input-dim 32x24 --struct 20x5x5-2s-10x3x3-2s-512-512 --output-dim 32 -o train.xml
./nn-train ../train_r10.dat ./train.xml ../test1_r10.dat train.dat.xml --input-dim 32x24


I have changed the learn rate to 2 and the accuracy start to change. But the performance is extremely bad. The accuracy wonders under 4%. By a simple network like 1024-1024 with default parameters, I can get an accuracy about 40%.

Do you have any suggestions?

Thank you.

I get that a lot, it's NOT a bug.
Sometimes it just stuck in the parameter space and never get away from it.
nn-init use rand to initialize the kernels, try to initialize it again.
You just need good luck when rolling the dice !

If you're lucky enough, it takes only 5-10 epoch to take off.
If not, re-initialize it again !
And try using a smaller learning rate such as 0.1 (which is the default value)

Thank you.