ultima modifica di oggi, le formule del costo, del gradiente dovrebbero essere giuste

This commit is contained in:
2025-01-23 21:24:30 +01:00
parent 9fd0fcb2fa
commit b87b4abd37
5 changed files with 107 additions and 98 deletions

View File

@@ -1,7 +1,8 @@
import math
import random
class Percettrone:
def __init__(self, w1 = 1, w2 = 1, bias = 1, lre = 0.2):
def __init__(self, w1 = random.uniform(-1, 1), w2 = random.uniform(-1, 1), bias = random.uniform(-1, 1), lre = 0.2):
self.w1 = w1
self.w2 = w2
self.bias = bias