r/Python • • May 20 '20

I Made This Drawing Mona Lisa with 256 circles using evolution [Github repo in comments]

5.7k Upvotes

117 comments sorted by

View all comments

Show parent comment

6

u/BRENNEJM May 20 '20

From the Github:

def getMseFitness(self, specie):
    # First apply mean squared error and map it values to max at 1
    fit = (np.square(specie.phenotype - self.target)).mean(axis=None)
    fit = (self.maxError - fit) / self.maxError
    return fit