Skip to content

Commit 7aa994e

Browse files
author
Yusuke Sugomori
committed
SdA.c
1 parent 94e1af8 commit 7aa994e

File tree

5 files changed

+612
-8
lines changed

5 files changed

+612
-8
lines changed

c/DBN.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ void DBN_predict(DBN* this, int *x, double *y) {
208208
}
209209

210210
for(i=0; i<this->log_layer.n_out; i++) {
211+
y[i] = 0;
211212
for(j=0; j<this->log_layer.n_in; j++) {
212213
y[i] += this->log_layer.W[i][j] * layer_input[j];
213214
}
@@ -525,7 +526,7 @@ void test_dbn(void) {
525526
int finetune_epochs = 500;
526527

527528
int train_N = 6;
528-
int test_N = 3;
529+
int test_N = 4;
529530
int n_ins = 6;
530531
int n_outs = 2;
531532
int hidden_layer_sizes[] = {3, 3};
@@ -562,13 +563,14 @@ void test_dbn(void) {
562563
DBN_finetune(&dbn, *train_X, *train_Y, finetune_lr, finetune_epochs);
563564

564565
// test data
565-
int test_X[3][6] = {
566+
int test_X[4][6] = {
566567
{1, 1, 0, 0, 0, 0},
568+
{1, 1, 1, 1, 0, 0},
567569
{0, 0, 0, 1, 1, 0},
568-
{1, 1, 1, 1, 1, 0}
570+
{0, 0, 1, 1, 1, 0}
569571
};
570572

571-
double test_Y[3][2];
573+
double test_Y[4][2];
572574

573575
// test
574576
for(i=0; i<test_N; i++) {

0 commit comments

Comments
 (0)