Skip to content

Commit 1bc3a17

Browse files
committed
Improve
1 parent 4481f28 commit 1bc3a17

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Diff for: Neural_Network/perceptron.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def trannig(self):
5252
epoch_count = epoch_count + 1
5353
# if you want controle the epoch or just by erro
5454
if erro == False:
55+
print('\nEpoch:\n',epoch_count)
56+
print('------------------------\n')
5557
#if epoch_count > self.epoch_number or not erro:
5658
break
5759

@@ -105,6 +107,7 @@ def sign(self, u):
105107
[2.4482, 0.9455, 11.2095],
106108
[2.0149, 0.6192, 10.9263],
107109
[0.2012, 0.2611, 5.4631]
110+
108111
]
109112

110113
exit = [-1, -1, -1, 1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, -1, -1, 1, 1, 1, 1, -1, 1, 1, 1, 1, -1, -1, 1, -1, 1]
@@ -114,12 +117,7 @@ def sign(self, u):
114117
network.trannig()
115118

116119
while True:
117-
i = 0
118120
sample = []
119-
while i < 3:
120-
value = input('value: ')
121-
value = float(value)
122-
sample.insert(i, value)
123-
i = i + 1
124-
121+
for i in range(3):
122+
sample.insert(i, float(input('value: ')))
125123
network.sort(sample)

0 commit comments

Comments
 (0)