aggiustamento codice

This commit is contained in:
2025-02-20 21:54:37 +01:00
parent d79bd87b73
commit b2d3a63711
3 changed files with 42 additions and 24 deletions

View File

@@ -61,9 +61,9 @@ double funzione_sigmoide(Percettrone p, double x1, double x2) {
}
void correggi_pesi(Percettrone *p, double grad_w1, double grad_w2, double grad_bias) {
(*p).bias = (*p).bias + (grad_bias * (*p).lre);
(*p).w1 = (*p).w1 + (grad_w1 * (*p).lre);
(*p).w2 = (*p).w2 + (grad_w2 * (*p).lre);
p->bias += (grad_bias * p->lre);
p->w1 += (grad_w1 * p->lre);
p->w2 += (grad_w2 * p->lre);
}
void stampa_layer_uno(Percettrone p, double y, int x1, int x2, double errore)