You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we only support ask & tell for DEHB. However, our package also offers to run DE itself. While it does have a run function, it would make sense to implement ask & tell to offer a unified interface for both DE and DEHB.
While ask & tell was relatively straight forward for DEHB, DE needs a little restructuring for making ask & tell work. In the following I will briefly talk about the required changes to DE and how I would tackle them.
1. Current DE implementation evolves per generation and not per individual
Since ask aims to provide single configurations to evaluate, we would need to adjust the current DE implementation to work on a per individual basis, as currently the whole generation evolved at once. The easiest way to allow for individual control would be simply adding a current_indiv_pointer as a property for DE which would be incremented after every ask and point at the next population index to create a trial from.
2. Selection happens after the whole generation has been evolved and evaluated (exception: AsyncDE with immediate, worst or random async strategy)
Since we would generally need to adjust DE to work on an individual level, we would also need to adjust the selction process as we cannot perform selection after every tell. Please note, that this is only the case for plain DE and AsyncDE with the deferred mutation strategy. The other async strategies (immediate, worst and random) already perform selection right after evolving and evaluating a single individual. Since we probably want to keep track of the number of tells by the user anyways (to give a warning if there have been more tells than asks), we could simply add a check for n_tells % population_size == 0 after incrementing n_tells in tell(..) and only perform selection then. A rough sketch of the code:
# For DEdeftell(trial, result):
self.n_tells+=1self.waiting_trials.append((trial, result))
# Only perform selection after whole population has been evolvedifself.n_tells%self.pop_size==0:
fortrial, resinself.waiting_trials:
self.selection(trial, res)
# For AsyncDEdeftell(trial, result):
self.n_tells+=1ifself.async_strategy=="deferrred":
self.waiting_trials.append((trial, result))
# Only perform selection after whole population has been evolvedifself.n_tells%self.pop_size==0:
fortrial, resinself.waiting_trials:
self.selection(trial, res)
elifself.async_strategy=="immediate":
# perform immediate selectionelse:
# perform worst/random selection
Please note, that this should only be a sketch to give an idea on how to implement tell. There would also need to be some changes e.g. to the selection routine.
The text was updated successfully, but these errors were encountered:
Currently, we only support ask & tell for DEHB. However, our package also offers to run DE itself. While it does have a
run
function, it would make sense to implement ask & tell to offer a unified interface for both DE and DEHB.While ask & tell was relatively straight forward for DEHB, DE needs a little restructuring for making ask & tell work. In the following I will briefly talk about the required changes to DE and how I would tackle them.
1. Current DE implementation evolves per generation and not per individual
Since ask aims to provide single configurations to evaluate, we would need to adjust the current DE implementation to work on a per individual basis, as currently the whole generation evolved at once. The easiest way to allow for individual control would be simply adding a
current_indiv_pointer
as a property for DE which would be incremented after everyask
and point at the next population index to create a trial from.2. Selection happens after the whole generation has been evolved and evaluated (exception:
AsyncDE
withimmediate
,worst
orrandom
async strategy)Since we would generally need to adjust DE to work on an individual level, we would also need to adjust the selction process as we cannot perform selection after every
tell
. Please note, that this is only the case for plainDE
andAsyncDE
with thedeferred
mutation strategy. The other async strategies (immediate
,worst
andrandom
) already perform selection right after evolving and evaluating a single individual. Since we probably want to keep track of the number of tells by the user anyways (to give a warning if there have been more tells than asks), we could simply add a check forn_tells % population_size == 0
after incrementingn_tells
intell(..)
and only perform selection then. A rough sketch of the code:Please note, that this should only be a sketch to give an idea on how to implement
tell
. There would also need to be some changes e.g. to the selection routine.The text was updated successfully, but these errors were encountered: