Skip to content

Commit

Permalink
SdA.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuke Sugomori committed Feb 13, 2013
1 parent 94e1af8 commit 7aa994e
Show file tree
Hide file tree
Showing 5 changed files with 612 additions and 8 deletions.
10 changes: 6 additions & 4 deletions c/DBN.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ void DBN_predict(DBN* this, int *x, double *y) {
}

for(i=0; i<this->log_layer.n_out; i++) {
y[i] = 0;
for(j=0; j<this->log_layer.n_in; j++) {
y[i] += this->log_layer.W[i][j] * layer_input[j];
}
Expand Down Expand Up @@ -525,7 +526,7 @@ void test_dbn(void) {
int finetune_epochs = 500;

int train_N = 6;
int test_N = 3;
int test_N = 4;
int n_ins = 6;
int n_outs = 2;
int hidden_layer_sizes[] = {3, 3};
Expand Down Expand Up @@ -562,13 +563,14 @@ void test_dbn(void) {
DBN_finetune(&dbn, *train_X, *train_Y, finetune_lr, finetune_epochs);

// test data
int test_X[3][6] = {
int test_X[4][6] = {
{1, 1, 0, 0, 0, 0},
{1, 1, 1, 1, 0, 0},
{0, 0, 0, 1, 1, 0},
{1, 1, 1, 1, 1, 0}
{0, 0, 1, 1, 1, 0}
};

double test_Y[3][2];
double test_Y[4][2];

// test
for(i=0; i<test_N; i++) {
Expand Down
Loading

0 comments on commit 7aa994e

Please sign in to comment.