optimize⚓︎
Descriptive description.
Optimize
⚓︎
Class for ensemble optimization algorithms. These are classified by calculating the sensitivity or gradient using ensemble instead of classical derivatives. The loop is else as a classic optimization loop: a state (or control variable) will be iterated upon using an algorithm defined in the update_scheme package.
Attributes:
Name | Type | Description |
---|---|---|
logger |
Logger
|
Print output to screen and log-file |
pickle_restart_file |
str
|
Save name for pickle dump/load |
optimize_result |
OptimizeResult
|
Dictionary with results for the current iteration |
iteration |
int
|
Iteration index |
max_iter |
int
|
Max number of iterations |
restart |
bool
|
Restart flag |
restartsave |
bool
|
Save restart information flag |
Methods:
Name | Description |
---|---|
run_loop |
The main optimization loop |
save |
Save restart file |
load |
Load restart file |
calc_update |
Empty dummy function, actual functionality must be defined by the subclasses |
__init__(**options)
⚓︎
Parameters:
Name | Type | Description | Default |
---|---|---|---|
options
|
dict
|
Optimization options |
{}
|
calc_update()
⚓︎
This is an empty dummy function. Actual functionality must be defined by the subclasses.
load()
⚓︎
Load a pickled file and save all info. in self.
run_loop()
⚓︎
This is the main optimization loop.
save()
⚓︎
We use pickle to dump all the information we have in 'self'. Can be used, e.g., if some error has occurred.