yusugomori / DeepLearning

Deep Learning (Python, C, C++, Java, Scala, Go)
https://yusugomori.com
MIT License
3.09k stars 1.36k forks source link

A Problem with the Deep Belief Network C++ codes #19

Open aykutm opened 8 years ago

aykutm commented 8 years ago

I applied your dbn.cpp code . But for your all test data, the prediction results are equal. It is an unexpected situation (if we give a training sample as a train sample it can not find the true class, too). What is the problem? I expect your help.

littlewei39 commented 8 years ago

you need to change the mod from Debug to Release, then the answer is right

carterbao commented 8 years ago

Why changing from Debug mode to Release makes it work?Could anyone explain that?

carterbao commented 8 years ago

I got it, in the HiddenLayer(int size, int in, int out, double **w, double *bp) construction function, after b = new double[n_out]; each element of b should be initialized to zero, otherwise they will be randomly initialized to be too large in debug mode. However in release mode, they are initialized to small values.

auxs2015 commented 7 years ago

@carterbao it works