In the following code snippet,
if evaluation_data:
n_data = len(evaluation_data)
n = len(training_data)
evaluation_cost, evaluation_accuracy = [], []
training_cost, training_accuracy = [], []
for j in list(range(epochs)):
random.shuffle(training_data)
mini_batches = training_data[k:k+mini_batch_size]
you can see that I'm not using xrange
.Although the code was written to run on pyhton2, I refactored to run it on python3. However, I'm keep getting the follwoing error:
................................Directory/network2.py", line 147, in SGD
for j in list(range(epochs)):
NameError: name 'xrange' is not defined
In the beginning, I used only range()
. Then after learning that range()
is not a list in python3 I did list(range())
. However, I'm keep getting the error for xrange
in both revised cases. Would appreciate if someone can help.