-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GA features update - Having multi-objective optimization (NSGA-II ) #2326
base: devel
Are you sure you want to change the base?
GA features update - Having multi-objective optimization (NSGA-II ) #2326
Conversation
…e iteration is completed.
…tests. Most of conflicts are resolved.
…enablingMinMaxList
Job Precheck on 014dae4 : invalidated by @joshua-cogliati-inl failed in fetch and branch |
Job Precheck on 014dae4 : invalidated by @joshua-cogliati-inl civet problems |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are my second part comments. Please let me know if you have any issues. In addition, Please try to make sure you can generate the manual for multi-objective optimization, and check the manual is complete. @Jimmy-INL @JunyungKim
# Fitness | ||
if self._survivorSelectionType not in ['ageBased','fitnessBased','rankNcrowdingBased']: | ||
self.raiseAnError(IOError, f'Currently constrained Genetic Algorithms only support ageBased, fitnessBased, and rankNcrowdingBased as a survivorSelector, whereas provided survivorSelector is {self._survivorSelectionType}') | ||
if len(self._objectiveVar) == 1 and self._survivorSelectionType == 'rankNcrowdingBased': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the error message, should you use if len(self._objectiveVar) <= 2
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand, I thought it works with multiobjective cases, even with two objrctives. At least that's what it should do. I will test it further.
# TODO: @mandd, please explore the possibility to convert the logistic fitness into a constrained optimization fitness. | ||
if 'Constraint' in self.assemblerObjects and self._fitnessType not in ['invLinear','feasibleFirst']: | ||
self.raiseAnError(IOError, f'Currently constrained Genetic Algorithms only support invLinear and feasibleFirst fitnesses, whereas provided fitness is {self._fitnessType}') | ||
if 'Constraint' in self.assemblerObjects and self._fitnessType not in ['invLinear','logistic', 'feasibleFirst']: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to use inputSpecs to check the fitnessType instead.
if len(self._objectiveVar) == 1: | ||
convs = {} | ||
for conv in self._convergenceCriteria: | ||
fName = conv[:1].upper() + conv[1:] | ||
# get function from lookup | ||
f = getattr(self, f'_checkConv{fName}') | ||
# check convergence function | ||
okay = f(traj, new=new, old=old) | ||
# store and update | ||
convs[conv] = okay | ||
else: | ||
convs = {} | ||
for conv in self._convergenceCriteria: | ||
fName = conv[:1].upper() + conv[1:] | ||
# get function from lookup | ||
f = getattr(self, f'_checkConv{fName}') | ||
# check convergence function | ||
okay = f(traj, new=new, old=old) | ||
# store and update | ||
convs[conv] = okay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see the different between if
and else
statements here. If so, I think you need to revert the changes.
if len(self._optPointHistory[traj]) < 2: | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine these lines within the if
statement and move them outside.
obj1 = o1[self._objectiveVar[0]] | ||
obj2 = o1[self._objectiveVar[1]] | ||
converged = (obj1 == self._convergenceCriteria['objective'] and obj2 == self._convergenceCriteria['objective']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines indicate the convergence only work for 2 objectives, I think you need to extend this part to handle multi-objectives optimizations with more than 2 objectives.
'rank': 0 if ((type(self._objectiveVar) == list and len(self._objectiveVar) == 1) or type(self._objectiveVar) == str) else rlz['rank'], | ||
'CD': 0 if ((type(self._objectiveVar) == list and len(self._objectiveVar) == 1) or type(self._objectiveVar) == str) else rlz['CD'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to simply these two lines, since the self._objectiveVar is a list.
Job Test Ubuntu 18 PIP on 730d7a4 : invalidated by @joshua-cogliati-inl cleared cache |
1 similar comment
Job Test Ubuntu 18 PIP on 730d7a4 : invalidated by @joshua-cogliati-inl cleared cache |
Job Test Ubuntu 18 PIP on 730d7a4 : invalidated by @joshua-cogliati-inl monitoring disk usage |
…x_ReBASE_05232024
Job Mingw Test on 9154004 : invalidated by @Jimmy-INL |
Job Test qsubs sawtooth on 9154004 : invalidated by @Jimmy-INL |
Job Test Fedora 32 on 9154004 : invalidated by @Jimmy-INL |
Job Test qsubs sawtooth on 9154004 : invalidated by @Jimmy-INL |
1 similar comment
Job Test qsubs sawtooth on 9154004 : invalidated by @Jimmy-INL |
…eral times equal to population size, this is new behaviour
evolution of individuals that satisfy the problem's constraints. It suppoort single-and | ||
multi-objective optimization problem.\\\\ $fitness = | ||
\left\{\begin{matrix} -obj & g_{j}(x)\geq 0 \; \forall j \\ -obj_{worst}- | ||
\Sigma_{j=1}^{J}<g\_j(x)> & otherwise \\ \end{matrix}\right$\\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The \right
probably should be \right\}
(As in the delimiter needs to be added)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Since this is a generated file, this should probably be fixed in the python code.)
Pull Request Description
What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)
#2069
What are the significant changes in functionality due to this change request?
For Change Control Board: Change Request Review
The following review must be completed by an authorized member of the Change Control Board.
<internalParallel>
to True.raven/tests/framework/user_guide
andraven/docs/workshop
) have been changed, the associated documentation must be reviewed and assured the text matches the example.