Skip to content

Commit

Permalink
fix sigmoid func
Browse files Browse the repository at this point in the history
  • Loading branch information
EmpereurMarcAurele committed Aug 9, 2017
1 parent 5dd58c2 commit 0026612
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
1 change: 1 addition & 0 deletions function.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ double sigmoid_deriv(double entry)

double sigmoid_func(double entry)
{
entry = 1 / (1 + exp(entry));
return (entry);
}
1 change: 1 addition & 0 deletions neural.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ t_neural *init_node(t_layer *, t_neural *, char);
t_layer *init_layer(int, char);
t_network *init_network(int, int, int, t_network *);
/* print.c */
void print_only_res(t_network *);
void print_layer(t_layer *);
/* fill_network.c */
void fill_layer_out(double *, t_layer *);
Expand Down
24 changes: 19 additions & 5 deletions print.c
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
#include "neural.h"

void print_only_res(t_network *network)
{
t_neural *node_out = network->output_l->start;

int i = 0;
while(node_out)
{
printf("nde number %d; value output = %f\n", i, node_out->value);
node_out = node_out->next;
i++;
}
printf("\n");
}

void print_layer(t_layer *layer)
{
t_neural *tmp;

tmp = layer->start;
while (tmp)
{
{
printf("target = %f ", tmp->target);
printf("value = %f ; w_sum = %f\n", tmp->value, tmp->w_sum);
tmp = tmp->next;
}
printf("\n");
printf("value = %f ; w_sum = %f\n", tmp->value, tmp->w_sum);
tmp = tmp->next;
}
printf("\n");
}
1 change: 1 addition & 0 deletions run_network.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ void run_network(t_network *network, int nb_it)
back_propagationHO(network);
process_hidden_l_error(network);
back_propagationIH(network);
print_only_res(network);
i++;
}
}

0 comments on commit 0026612

Please sign in to comment.