This commit is contained in:
Glenn Jocher 2020-01-22 11:23:16 -08:00
parent 3de61b1fa5
commit e6ec7c041c
1 changed files with 1 additions and 1 deletions

View File

@ -448,7 +448,7 @@ if __name__ == '__main__':
# Select parent(s)
parent = 'single' # parent selection method: 'single' or 'weighted'
x = np.loadtxt('evolve.txt', ndmin=2)
n = min(3, len(x)) # number of previous results to consider
n = min(5, len(x)) # number of previous results to consider
x = x[np.argsort(-fitness(x))][:n] # top n mutations
if parent == 'single' or len(x) == 1:
x = x[random.randint(0, n - 1)] # select one of the top n