Skip to content

Instantly share code, notes, and snippets.

@RileyLazarou
Created November 10, 2019 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RileyLazarou/3f4d59213ce40b37cfca5614e3c62387 to your computer and use it in GitHub Desktop.
Save RileyLazarou/3f4d59213ce40b37cfca5614e3c62387 to your computer and use it in GitHub Desktop.
Neural Network Organism Mutation
class Organism():
# [Some code removed here]
def mutate(self, stdev=0.03):
for i in range(len(self.layers)):
self.layers[i] += np.random.normal(0, stdev, self.layers[i].shape)
if self.use_bias:
self.biases[i] += np.random.normal(0, stdev, self.biases[i].shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment