Skip to content

Commit bf3bdf8

Browse files
authored
more minor spacing
1 parent d3fe18e commit bf3bdf8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

learning.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def euclidean_distance(X, Y):
2424

2525
def cross_entropy_loss(X,Y):
2626
n=len(X)
27-
return (-1.0/n)*sum(x*math.log(y)+(1-x)*math.log(1-y) for x,y in zip(X,Y) )
27+
return (-1.0/n)*sum(x*math.log(y) + (1-x)*math.log(1-y) for x, y in zip(X, Y))
2828

2929

3030
def rms_error(X, Y):
@@ -643,6 +643,7 @@ def predict(example):
643643
for test, outcome in predict.decision_list:
644644
if passes(example, test):
645645
return outcome
646+
646647
predict.decision_list = decision_list_learning(set(dataset.examples))
647648

648649
return predict
@@ -668,7 +669,6 @@ def NeuralNetLearner(dataset, hidden_layer_sizes=None,
668669
learning_rate, epochs)
669670

670671
def predict(example):
671-
672672
# Input nodes
673673
i_nodes = learned_net[0]
674674

@@ -696,7 +696,7 @@ def random_weights(min_value, max_value, num_weights):
696696

697697

698698
def BackPropagationLearner(dataset, net, learning_rate, epochs):
699-
"""[Figure 18.23] The back-propagation algorithm for multilayer network"""
699+
"""[Figure 18.23] The back-propagation algorithm for multilayer networks"""
700700
# Initialise weights
701701
for layer in net:
702702
for node in layer:

0 commit comments

Comments
 (0)