print("-" * 10 + " Initializing Weights " + "-" * 10) for row in network: if row != network[0]: print("randomising neuron in row" + str(row)) for key, neuron in row.neurons.items(): print("scrambling neuron no." + str(key)) neuron.scramble() print("-" * 10 + " Initializing Initial Activations " + "-" * 10) index = r.randrange(0, len(images)) for key, neuron in init_row.neurons.items(): neuron.activation = images[index][key] print(str(neuron.id) + " was updated with: " + str(images[index][key])) print("-" * 10 + " Running network " + "-" * 10) init_row.send() print("The actual value is: " + str(labels[index])) loop = input("\nWhat now? (run/scramble/quit/img/next): ") while True: if loop == "run": init_row.send() print("The actual value is: " + str(labels[index])) elif loop == "img": print(mndata.display(images[index])) elif loop == "scramble": print("-" * 10 + " Initializing Weights " + "-" * 10) for row in network: if row != network[0]: print("randomising neuron in row" + str(row)) for key, neuron in row.neurons.items():