mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-06 21:23:13 +02:00
fix: some magic
This commit is contained in:
parent
eff54a6b61
commit
7f8f34af0b
@ -27,7 +27,7 @@ def evolution_strategy(top_individuals, lambda_, sigma, iterations):
|
|||||||
|
|
||||||
# Generate the next generation of lambda individuals by recombination
|
# Generate the next generation of lambda individuals by recombination
|
||||||
children = np.concatenate(
|
children = np.concatenate(
|
||||||
[np.random.permutation(parents) for i in range(lambda_)])
|
[np.random.permutation(parents) for i in range(lambda_ // top_individuals)])
|
||||||
|
|
||||||
# Add mutation to the children
|
# Add mutation to the children
|
||||||
mutation = np.random.normal(loc=0, scale=sigma, size=(lambda_, 2))
|
mutation = np.random.normal(loc=0, scale=sigma, size=(lambda_, 2))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user