offsprings = []
scores = np.array(scores, dtype="float")
if np.sum(scores) < self.eps:
scores = [self.eps for _ in range(self.population_size)]
probas_to_be_parent = scores / np.sum(scores)
intervals = np.array([np.sum(probas_to_be_parent[:i]) for i in range(self.population_size)])
for i in range(self.population_size - self.n_saved_best_pretrained):
After Change
ranges = self.range_scores(scores)
a = 1. / (1. - self.population_size)
b = self.population_size / (self.population_size - 1.)
probas_to_be_parent = (a * ranges + b) / np.sum(a * ranges + b)
intervals = np.array([np.sum(probas_to_be_parent[:i]) for i in range(self.population_size)])
for i in range(self.population_size - self.n_saved_best_pretrained):
rs = np.random.random(2)