Skip to content

Commit

Permalink
Issue yusugomori#1 bug fix on C C++ Java
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuke Sugomori committed Jun 23, 2013
1 parent 5e4203f commit cbd7833
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion c/DBN.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ void DBN_predict(DBN* this, int *x, double *y) {
for(i=0; i<this->n_layers; i++) {
layer_input = (double *)malloc(sizeof(double) * this->sigmoid_layers[i].n_out);

linear_output = 0.0;
for(k=0; k<this->sigmoid_layers[i].n_out; k++) {
linear_output = 0.0;

for(j=0; j<this->sigmoid_layers[i].n_in; j++) {
linear_output += this->sigmoid_layers[i].W[k][j] * prev_layer_input[j];
}
Expand Down
3 changes: 2 additions & 1 deletion c/SdA.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@ void SdA_predict(SdA* this, int *x, double *y) {
for(i=0; i<this->n_layers; i++) {
layer_input = (double *)malloc(sizeof(double) * this->sigmoid_layers[i].n_out);

linear_output = 0.0;
for(k=0; k<this->sigmoid_layers[i].n_out; k++) {
linear_output = 0.0;

for(j=0; j<this->sigmoid_layers[i].n_in; j++) {
linear_output += this->sigmoid_layers[i].W[k][j] * prev_layer_input[j];
}
Expand Down
3 changes: 2 additions & 1 deletion cpp/DBN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,9 @@ void DBN::predict(int *x, double *y) {
for(int i=0; i<n_layers; i++) {
layer_input = new double[sigmoid_layers[i]->n_out];

linear_output = 0.0;
for(int k=0; k<sigmoid_layers[i]->n_out; k++) {
linear_output = 0.0;

for(int j=0; j<sigmoid_layers[i]->n_in; j++) {
linear_output += sigmoid_layers[i]->W[k][j] * prev_layer_input[j];
}
Expand Down
3 changes: 2 additions & 1 deletion cpp/SdA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ void SdA::predict(int *x, double *y) {
for(int i=0; i<n_layers; i++) {
layer_input = new double[sigmoid_layers[i]->n_out];

linear_output = 0.0;
for(int k=0; k<sigmoid_layers[i]->n_out; k++) {
linear_output = 0.0;

for(int j=0; j<sigmoid_layers[i]->n_in; j++) {
linear_output += sigmoid_layers[i]->W[k][j] * prev_layer_input[j];
}
Expand Down
3 changes: 2 additions & 1 deletion java/DBN/src/DBN.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ public void predict(int[] x, double[] y) {
for(int i=0; i<n_layers; i++) {
layer_input = new double[sigmoid_layers[i].n_out];

linear_output = 0.0;
for(int k=0; k<sigmoid_layers[i].n_out; k++) {
linear_output = 0.0;

for(int j=0; j<sigmoid_layers[i].n_in; j++) {
linear_output += sigmoid_layers[i].W[k][j] * prev_layer_input[j];
}
Expand Down
3 changes: 2 additions & 1 deletion java/SdA/src/SdA.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ public void predict(int[] x, double[] y) {
for(int i=0; i<n_layers; i++) {
layer_input = new double[sigmoid_layers[i].n_out];

linear_output = 0.0;
for(int k=0; k<sigmoid_layers[i].n_out; k++) {
linear_output = 0.0;

for(int j=0; j<sigmoid_layers[i].n_in; j++) {
linear_output += sigmoid_layers[i].W[k][j] * prev_layer_input[j];
}
Expand Down

0 comments on commit cbd7833

Please sign in to comment.