Copyright: 2021 Yiqing Li (anne.yiqing.li@outlook.com)
Explorative gradient method for non-convex optimization of multiple parameters. Instructions to use the EGM optimizer.
Li, Y., Cui, W., Jia, Q., Li, Q., Yang, Z., Morzyński, M., & Noack, B. R. (2021).Explorative gradient method for active drag reduction of the fluidic pinball and slanted Ahmed body. Journal of Fluid Mechanics, 932, A7. DOI: https://doi.org/10.1017/jfm.2021.974
Unzip the tar.gz file.
MATLAB is needed. Machine learning tool box for MATLAB is needed. This version has been developped on MATLAB version R2018b. Please contact anne.yiqing.li@outlook.com in case of error.
The main folder should contain the following folders and files:
- README.md
- Initialization.m is a script to initialize.
- Restart.m is a script to restart the optimization.
- @EGM/, @Esample/, @Gsimplex/, @Mtable/ defines the objects in EGM algorithm.
- Tools/ contains functions and files not used by the EGM class objects.
- Plant/ contains the problems and parameters.
- save_runs/ contains the saved EGM object and figures.
To start, run matlab in the main folder. Then run Initialization.m to load the path.
Initialization;
Create an EGM object to solve the toy problem. Or specify a new problem to be solved, which should be defined in folder Plant/.
egm = EGM();
egm = EGM('new_problem');
Start the iteration of optimization round by round. Or run several rounds. The first group of vertices in the sapce (a simplex including N+1 vertices with N variables) will evolve with the help of EGM which makes a balance of exploration and exploit.
egm.go; % To run 1 round.
egm.go(10); % To run 10 rounds.
Print the information of the best vertex after the latest round. Print the information of several best vertices after a certain round.
egm.best_vertex;
egm.best_vertices(num_th_round, num_best_vertices);
Visualize the learning curve of cost function.
egm.learningCurve;
Visualize the control landscape during or after optimization.
egm.controlLandscape(5);
% Visualize the studied vertices in the former 5th round with proximity map generated by vertices in all rounds as background.
egm.controlLandscape;
% Visualize and save the final control landscape with all the studied vertices.
Print and save the current figure.
egm.printFigure('Name_of_Figure');
EGM parameters are related to exploit and exploration steps. For more details(like parameters about the problem), see default_parameters.m.
Gradient_simplex parameters include:
simplexMirrorStep = 1;
simplexContractStep = 0.5;
simplexExpandStep = 2;
simplexShrinkStep = 1/2;
simplexParam = ...
[simplexMirrorStep simplexContractStep simplexExpandStep simplexShrinkStep];
parameters.simplexParam = simplexParam;
parameters.simplexSize = parameters.inputDimen + 1;
% The simplex size is related to the problem, see *default_parameters.m*.
parameters.gradient_Nstep = 1;
Exploration_sample parameters include:
parameters.sampleSetSize = 1e3;
parameters.punishCost = 10;
parameters.exploration_Nstep = 1;
To avoid being overwritten, it is better to save and load with a given name of a run. If not given, the EGM object is saved as 'EGM'. For more details, see CheatSheet.m.
egm.save_results;
egm.load_obj('Name_of_Run');
Version 0.1.4.1
Yiqing Li
EGM (Explorative Gradient Method) for non-convex optimization of multiple parameters. Copyright (c) 2019,Yiqing Li (anne.yiqing.li@outlook.com)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
- The author thanks Guy Y. Cornejo Maceda (https://www.cornejomaceda.com/) for help on the code organization.
- The author also thanks Bernd R. Noack (http://berndnoack.com/) and Zhigang Yang for their precious guidance.