mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-30 18:36:43 +00:00
Travis CI: Add pytest --doctest-modules neural_network (#1028)
* neural_network/perceptron.py: Add if __name__ == '__main__': * Remove tab indentation * Add neural_network to the pytests
This commit is contained in:
parent
4658f4a49e
commit
c2e8582abd
@ -26,6 +26,7 @@ script:
|
|||||||
linear_algebra_python
|
linear_algebra_python
|
||||||
matrix
|
matrix
|
||||||
networking_flow
|
networking_flow
|
||||||
|
neural_network
|
||||||
other
|
other
|
||||||
project_euler
|
project_euler
|
||||||
searches
|
searches
|
||||||
|
@ -113,12 +113,13 @@ samples = [
|
|||||||
|
|
||||||
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]
|
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]
|
||||||
|
|
||||||
network = Perceptron(sample=samples, exit = exit, learn_rate=0.01, epoch_number=1000, bias=-1)
|
if __name__ == '__main__':
|
||||||
|
network = Perceptron(sample=samples, exit = exit, learn_rate=0.01, epoch_number=1000, bias=-1)
|
||||||
|
|
||||||
network.training()
|
network.training()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
sample = []
|
sample = []
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
sample.insert(i, float(input('value: ')))
|
sample.insert(i, float(input('value: ').strip()))
|
||||||
network.sort(sample)
|
network.sort(sample)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user