FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

"epoches" to "epochs" by antmarakis · Pull Request #336 · aimacode/aima-python · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
14 changes: 7 additions & 7 deletions learning.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,11 @@ def predict(example):


def NeuralNetLearner(dataset, hidden_layer_sizes=[3],
learning_rate=0.01, epoches=100):
learning_rate=0.01, epochs=100):
"""Layered feed-forward network.
hidden_layer_sizes: List of number of hidden units per hidden layer
learning_rate: Learning rate of gradient descent
epoches: Number of passes over the dataset
epochs: Number of passes over the dataset
"""

i_units = len(dataset.inputs)
Expand All @@ -447,7 +447,7 @@ def NeuralNetLearner(dataset, hidden_layer_sizes=[3],
# construct a network
raw_net = network(i_units, hidden_layer_sizes, o_units)
learned_net = BackPropagationLearner(dataset, raw_net,
learning_rate, epoches)
learning_rate, epochs)

def predict(example):

Expand Down Expand Up @@ -510,7 +510,7 @@ def network(input_units, hidden_layer_sizes, output_units):
return net


def BackPropagationLearner(dataset, net, learning_rate, epoches):
def BackPropagationLearner(dataset, net, learning_rate, epochs):
"""[Figure 18.23] The back-propagation algorithm for multilayer network"""
# Initialise weights
for layer in net:
Expand All @@ -530,7 +530,7 @@ def BackPropagationLearner(dataset, net, learning_rate, epoches):
o_nodes = net[-1]
i_nodes = net[0]

for epoch in range(epoches):
for epoch in range(epochs):
# Iterate over each example
for e in examples:
i_val = [e[i] for i in idx_i]
Expand Down Expand Up @@ -583,13 +583,13 @@ def BackPropagationLearner(dataset, net, learning_rate, epoches):
return net


def PerceptronLearner(dataset, learning_rate=0.01, epoches=100):
def PerceptronLearner(dataset, learning_rate=0.01, epochs=100):
"""Logistic Regression, NO hidden layer"""
i_units = len(dataset.inputs)
o_units = 1 # As of now, dataset.target gives only one index.
hidden_layer_sizes = []
raw_net = network(i_units, hidden_layer_sizes, o_units)
learned_net = BackPropagationLearner(dataset, raw_net, learning_rate, epoches)
learned_net = BackPropagationLearner(dataset, raw_net, learning_rate, epochs)

def predict(example):
# Input nodes
Expand Down

Back | FazBrowse Home | New Git URL