Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve
  • Loading branch information
frmatias committed Aug 28, 2017
commit 1bc3a17d5e3de8de4a3e765e38ac998ee1004da9
12 changes: 5 additions & 7 deletions Neural_Network/perceptron.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def trannig(self):
epoch_count = epoch_count + 1
# if you want controle the epoch or just by erro
if erro == False:
print('\nEpoch:\n',epoch_count)
print('------------------------\n')
#if epoch_count > self.epoch_number or not erro:
break

Expand Down Expand Up @@ -105,6 +107,7 @@ def sign(self, u):
[2.4482, 0.9455, 11.2095],
[2.0149, 0.6192, 10.9263],
[0.2012, 0.2611, 5.4631]

]

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]
Expand All @@ -114,12 +117,7 @@ def sign(self, u):
network.trannig()

while True:
i = 0
sample = []
while i < 3:
value = input('value: ')
value = float(value)
sample.insert(i, value)
i = i + 1

for i in range(3):
sample.insert(i, float(input('value: ')))
network.sort(sample)