Skip to content
Snippets Groups Projects
Commit faded250 authored by vincent.steinman's avatar vincent.steinman
Browse files

add stuff

parent c3da7684
No related branches found
No related tags found
No related merge requests found
File added
...@@ -14,6 +14,8 @@ ETA = 0.5 ...@@ -14,6 +14,8 @@ ETA = 0.5
NBNEURON = 10 NBNEURON = 10
ACTIVATION = lambda x : (1/(1 + np.exp(-x))) ACTIVATION = lambda x : (1/(1 + np.exp(-x)))
per_lst = []
def getNewWeight(weight: float, result: float, neuron_value: float, expected_value: int) -> float: def getNewWeight(weight: float, result: float, neuron_value: float, expected_value: int) -> float:
return weight + ETA * (expected_value - result) * result * (1 - result) * neuron_value return weight + ETA * (expected_value - result) * result * (1 - result) * neuron_value
...@@ -23,6 +25,14 @@ def getSlope(weights: list[float]) -> Tuple[float, float]: ...@@ -23,6 +25,14 @@ def getSlope(weights: list[float]) -> Tuple[float, float]:
return pente, origine return pente, origine
def neuron(data: pd.DataFrame, weights: list[float], activation):
for i in range(NBNEURON):
perceptron(data, weights, activation)
def gradient():
#somme (t-o)o(1-o)x
pass
def perceptron(data: pd.DataFrame, weights: list[float], activation) -> list[float]: def perceptron(data: pd.DataFrame, weights: list[float], activation) -> list[float]:
predicted = data["success"].tolist() predicted = data["success"].tolist()
for __ in range(0, 2000): for __ in range(0, 2000):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment