Skip to content

Commit

Permalink
Fixing up duplicate error.
Browse files Browse the repository at this point in the history
  • Loading branch information
gugarosa authored Nov 12, 2018
1 parent 6fee7df commit 470601e
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/dbn.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,6 @@ n_visible_units: number of visible units of the bottom RBM
n_hidden_units: array with the number of hidden units of each RBM
n_labels: number of labels
n_layers: number of layers */
DBN *CreateDBN(int n_visible_units, gsl_vector *n_hidden_units, int n_labels, int n_layers)
{
DBN *d = NULL;
int i;

if ((n_hidden_units) && (n_hidden_units->size == n_layers))
{
d = (DBN *)malloc(sizeof(DBN));
d->n_layers = n_layers;
d->m = (RBM **)malloc(d->n_layers * sizeof(RBM *));

//only the first layer has the number of visible inputs equals to the number of features
d->m[0] = CreateRBM(n_visible_units, (int)gsl_vector_get(n_hidden_units, 0), n_labels);
for (i = 1; i < d->n_layers; i++)
d->m[i] = CreateRBM((int)gsl_vector_get(n_hidden_units, i - 1), (int)gsl_vector_get(n_hidden_units, i), n_labels);

return d;
}
else
{
fprintf(stderr, "\nArray of hidden units not allocated or with a different number of hidden layers (n_layers) @CreateDBN\n");
}
}

DBN *CreateDBN(int n_visible_units, gsl_vector *n_hidden_units, int n_labels, int n_layers)
{
DBN *d = NULL;
Expand Down

0 comments on commit 470601e

Please sign in to comment.