Skip to content

Commit

Permalink
DBN__destruct
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuke Sugomori committed Feb 11, 2013
1 parent 876e9ff commit c4dbea6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions c/DBN.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ void DBN__construct(DBN* this, int N, \
}

void DBN__destruct(DBN* this) {

int i;
for(i=0; i<this->n_layers; i++) {
HiddenLayer__destruct(&(this->sigmoid_layers[i]));
RBM__destruct(&(this->rbm_layers[i]));
}
free(this->sigmoid_layers);
free(this->rbm_layers);
}

void DBN_pretrain(DBN* this, int *input, double lr, int k, int epochs) {
Expand Down Expand Up @@ -561,13 +567,15 @@ void test_dbn(void) {
}
printf("\n");
}

// destruct DBN
DBN__destruct(&dbn);

}



int main(void) {
test_dbn();

return 0;
}

0 comments on commit c4dbea6

Please sign in to comment.