nasa / bingo

Apache License 2.0
47 stars 28 forks source link

Deep copy of full fitness function in fitness predictor fitness function #62

Closed nightdr closed 2 years ago

nightdr commented 2 years ago

If I remember correctly, this fixes a bug where the fitness predictor fitness function keeps the full dataset rather than its subset. I wasn't in the meeting when you guys found this bug, so could you fill me in on why this solution works? If we end up changing the training data on the fitness function, I don't see why the distinction between copy and deepcopy would matter.

gbomarito commented 2 years ago

This was required for the case where the fitness function contains a wrapped fitness function (like our common case of CLO wrapping explicit regression). When copies were being made, it was only copying the CLO object with reference tot he same underlying explicit regression object. then when we were changing the training data in one location it was changing the training data in all locations (because they all referenced the same explicit regression). This had the overall effect of occasionally training the population on the "whole" dataset occasionally rather than the intended subset of the data

nightdr commented 2 years ago

Ah that makes perfect sense now. Thanks!