neat-python icon indicating copy to clipboard operation
neat-python copied to clipboard

Help with novelty search

Open TheMightiestCarrot opened this issue 3 years ago • 1 comments

Hey guys,

can someone help me with implementation of novelty serach in neat-python? Or at least explain the novelty serach example? Is this the novelty part?: `

        for a in self.archive:
            adist = np.linalg.norm(float_image.ravel() - a.ravel())
            genome.fitness = min(genome.fitness, adist)

`

Is the implementation problem specific? (distance in Behavior space) Or can it be implemented in more general way by measuring distance of model parameters?

TheMightiestCarrot avatar Jun 17 '22 10:06 TheMightiestCarrot

I think behavior space is the right place for measuring novelty. You could refactor it to choose from many kinds of distance functions.


def L2_distance(a, b):
    return np.linalg.norm(a - b, ord=2)

def L1_distance(a,b):
    return np.linalg.norm(a - b, ord=1)

for a in self.archive:
    adist = L2_distance(float_image.ravel(), a.ravel())
    # adist = L1_distance(float_image.ravel(), a.ravel())
    genome.fitness = min(genome.fitness, adist)

Note that changing a distance function here by plugging it into another monotonic function probably won't have any effect on the training. So L2 will work the same as distance = L2*x+y

DBraun avatar Jul 06 '22 23:07 DBraun