|
98 | 98 | "proportion_mutation = 0.80 #@param {type:\"number\"}\n", |
99 | 99 | "minval = -5.12 #@param {type:\"number\"}\n", |
100 | 100 | "maxval = 5.12 #@param {type:\"number\"}\n", |
101 | | - "batch_size = 100 #@param {type:\"integer\"}\n", |
102 | 101 | "genotype_dim = 6 #@param {type:\"integer\"}\n", |
103 | 102 | "lag = 2.2 #@param {type:\"number\"}\n", |
104 | 103 | "base_lag = 0 #@param {type:\"number\"}\n", |
|
184 | 183 | "key = jax.random.key(0)\n", |
185 | 184 | "key, subkey = jax.random.split(key)\n", |
186 | 185 | "genotypes = jax.random.uniform(\n", |
187 | | - " subkey, (batch_size, genotype_dim), minval=minval, maxval=maxval, dtype=jnp.float32\n", |
| 186 | + " subkey, (population_size, genotype_dim), minval=minval, maxval=maxval, dtype=jnp.float32\n", |
188 | 187 | ")\n", |
189 | 188 | "\n", |
190 | 189 | "# Mutation & Crossover\n", |
|
202 | 201 | ")\n", |
203 | 202 | "\n", |
204 | 203 | "# Define the emitter\n", |
| 204 | + "# NSGA-II and SPEA2 use batch size = population size\n", |
205 | 205 | "mixing_emitter = MixingEmitter(\n", |
206 | 206 | " mutation_fn=mutation_function, \n", |
207 | 207 | " variation_fn=crossover_function, \n", |
208 | 208 | " variation_percentage=1-proportion_mutation, \n", |
209 | | - " batch_size=batch_size\n", |
| 209 | + " batch_size=population_size, \n", |
210 | 210 | ")" |
211 | 211 | ] |
212 | 212 | }, |
|
0 commit comments