-
Notifications
You must be signed in to change notification settings - Fork 123
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
Framework for Multi-Objective Optimizations #120
Conversation
class DTLZ1 | ||
{ | ||
public: | ||
//! Initialize the DTLZ1 function. |
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 Indentation is off, but I think you already mentioned this in IRC.
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.
Have you folks considered using .clang-format
for autoformatting and adding an .editorconfig
to enforce the project style proactively?
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.
For mlpack we did setup a Jenkins Job that checks the style, I think we should do the same for ensmallen. About autoformatting, haven't tested it yet, maybe this is an option saves us some time.
|
||
arma::vec mins(max.n_rows); | ||
for (size_t i = 0; i < mins.n_elem; i++) | ||
mins[i] = max.row(i).index_max(); |
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.
We can bump the armadillo version as done here: https://github.com/mlpack/ensmallen/pull/119/files#diff-354f30a63fb0907d4ad57269548329e3 to fix the build issue.
|
||
#ifndef ENSMALLEN_INDICATORS_IGD_HPP | ||
#define ENSMALLEN_INDICATORS_IGD_HPP | ||
|
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.
It might be a good idea to cite: "Scalable Multi-Objective Optimization Test Problems". And add a simple class description for each function, similar to: https://github.com/mlpack/ensmallen/blob/master/include/ensmallen_bits/problems/himmelblau_function.hpp
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.
Yup, I'll do the documentation once I finish the code for reference points
|
||
class IGD | ||
{ | ||
double Indicate(arma::cube& front, |
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.
Can you comment on each parameter.
double Indicate(arma::cube& front, | ||
arma::cube& referenceFront) | ||
{ | ||
double igd = 0; |
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.
looks like the indentation (2 spaces) is off.
R = arma::join_slices(population, Q); | ||
|
||
// Evaluate R. | ||
arma::mat fitnessValues(function.NumObjectives(), R.n_slices); |
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.
Looks like we could put this outside the for loop and reuse the parameter for each iteration.
arma::mat asf(function.NumObjectives(), function.NumObjectives(), | ||
arma::fill::eye); | ||
|
||
for (size_t i = 0; i < asf.n_rows; i++) |
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.
You could use asf.diag().fill(1e6)
instead of the two for loops.
arma::mat max(asf.n_rows, fronts[0].size()); | ||
for (size_t i = 0; i < asf.n_rows; i++) | ||
{ | ||
arma::mat f_asf = f.t() * asf.row(i); |
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 use camel casing for all names.
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.
Yup, I'll fix it once testing is done. I just did it this way so it's easier to compare to the python numpy implementation
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.
Okay, sounds good.
size_t minIdx = 0; | ||
for (size_t i = 0; i < fronts[l].size(); i++) | ||
{ | ||
arma::mat s = nextPop.slice(i); |
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.
We could avoid another copy if we directly use nextPop.slice(i)
and referenceSet.slice(randIdx)
.
First commits from the new laptop? |
Yup, I guess I have some fixing to do |
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions! 👍 |
Closing because of #149 |
@favre49 I think this a great PR. We can definitely port the indicators module and DLTZ module from here. Allow me to steal your work :). In fact, we can dismantle this PR piece-by-piece; first port the Indicators (easy), then the DLTZ suite and then if we're feeling adventurous, NSGA-III as well; all in separate PR. |
Some resources for NSGA-III and DLTZ
What I like about Prof. Tsung's implementation is that he has provided us with Pareto Front of the DLTZ. For demonstrations purposes, we can take the txt file of the Front, load it in a IPython Notebook and plot it there. We could then visually compare with the DLTZ front from the paper. Perfect, no? |
This PR will add a framework for multi-objective optimization. This will include the DTLZ problems, the NSGA-III optimizer and some indicators (hypervolume, generational distance, epsilon).