Skip to content
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

Normalization for chebychev correct? #1614

Closed
peteole opened this issue Jan 5, 2023 · 9 comments
Closed

Normalization for chebychev correct? #1614

peteole opened this issue Jan 5, 2023 · 9 comments
Assignees
Labels
other_improvement Not a bug, new feature, refactor, or documentation, e.g. making code more clear WIP Work in Progress

Comments

@peteole
Copy link

peteole commented Jan 5, 2023

Hi, I would like to make sure that the objective values get normalized to the correct interval in the get_chebyvhev_scalarization function. Right now values get normalized to [0,1] for maximization. However, this results in every weight vector having a component of zero scalarizing every objective vector to zero since min(0,...)=0 if every element>=0. Also, for minimization the literature suggests normalizing to [0,1] instead of [-1,0]. Is this intended behavior or should the normalization interval maybe be flipped?

@esantorella esantorella self-assigned this Jan 5, 2023
@esantorella
Copy link
Member

Hi @peteole , thanks for reaching out! I'm not sure I follow what the problem is; could you share a reproducible example (code snippet) so we can see what is going wrong?

@Balandat
Copy link
Contributor

Balandat commented Jan 5, 2023

for minimization the literature suggests normalizing to [0,1] instead of [-1,0]

Note that this is under the convention that the augmented Chevyshev function is defined as max(w * y) + alpha * sum(w * y) (see [1]), whereas in get_chebyshev_scalarization our convention is min(w * y) + alpha * sum(w * y).

cc @sdaulton, @saitcakmak

[1] J. Knowles, "ParEGO: a hybrid algorithm with on-line landscape approximation for expensive multiobjective optimization problems," in IEEE Transactions on Evolutionary Computation, vol. 10, no. 1, pp. 50-66, Feb. 2006.

@peteole
Copy link
Author

peteole commented Jan 5, 2023

Hi @peteole , thanks for reaching out! I'm not sure I follow what the problem is; could you share a reproducible example (code snippet) so we can see what is going wrong?

Sure: Consider the following code snippet:

from botorch.utils.multi_objective.scalarization import get_chebyshev_scalarization
N_OBJECTIVES=3
# Y is not normalized
Y_values=torch.rand(10,N_OBJECTIVES)*3-1
weight=torch.tensor([1,0,0])
scalarization=get_chebyshev_scalarization(weight,Y_values,alpha=0)
scalarized_values=scalarization(Y_values)
# prints tensor of zeros
print(scalarized_values)

@peteole
Copy link
Author

peteole commented Jan 5, 2023

Note that this is under the convention that the augmented Chevyshev function is defined as max(w * y) + alpha * sum(w * y) (see [1]), whereas in get_chebyshev_scalarization our convention is min(w * y) + alpha * sum(w * y).

You're right, but in our convention, the weight is also negative. Shouldn't negative weights with min be equivalent to positive weights with max?

@saitcakmak
Copy link
Contributor

saitcakmak commented Jan 5, 2023

However, this results in every weight vector having a component of zero scalarizing every objective vector to zero since min(0,...)=0 if every element>=0.

So, if you actually have a weight vector that includes a 0, you're right that this is indeed a problem. We generally sample the weight vectors from unit simplex, which has probability 0 of producing a weight vector with a 0 component.

I haven't given enough thought to potential issues arising from flipping the normalization intervals. I am guessing it would require additional changes to make sure the code works for both maximization & minimization (where we maximize the negative) objectives.

@sdaulton
Copy link
Contributor

sdaulton commented Jan 5, 2023

Hi @peteole,

Thanks for raising this issue.

For the non-augmented chebyshev formulation in botorch, a larger weight means that an objective is less important (and a weight of zero means the objective is of the utmost importance). This is counterintuitive, and we should change this. Furthermore, this causes the issue you have found where a weights of zero are the most influential (note: in typical scenarios zeros are not present as Sait pointed out, but the issue remains, whether or not the weights contain zeros).

For the augmented chebyshev scalarization, there is a further issue in that a large weight in the first term means the objective is not important, but a large weight in second term means that the objective is important. This does not align with the classical augmented chebyshev scalarization where all objectives are minimized and the goal is to minimize g(y)

g(Y) = max_i(Y_i w_i) + alpha * sum_i(Y_iw_i).

I'll put up a PR.

sdaulton added a commit to sdaulton/botorch that referenced this issue Jan 5, 2023
Summary: See pytorch#1614

Differential Revision: D42373368

fbshipit-source-id: 0a1417d8865c943851430866df4f9369d0e21bf0
@sdaulton
Copy link
Contributor

sdaulton commented Jan 5, 2023

@peteole, #1616 should resolve this issue. Let me know if there are additional concerns

@peteole
Copy link
Author

peteole commented Jan 5, 2023

@sdaulton this looks like a good solution to me. We might want to add a convenience option to multiply the scalarized value by -1 so that the function can be used with a maximizer instead of a minimizer?

@sdaulton
Copy link
Contributor

sdaulton commented Jan 5, 2023

This scalarization should be maximized as is (although its values are non-positive)

sdaulton added a commit to sdaulton/botorch that referenced this issue Jan 15, 2023
Summary:
Pull Request resolved: pytorch#1616

See pytorch#1614

Differential Revision: D42373368

fbshipit-source-id: 5b705efadd3c1259e8f7fd73964c882f40ae5150
sdaulton added a commit to sdaulton/botorch that referenced this issue Jan 15, 2023
Summary:
Pull Request resolved: pytorch#1616

See pytorch#1614

Differential Revision: D42373368

fbshipit-source-id: 828dee51734cc54bf3f01c1876af05f9ae8b7201
@esantorella esantorella added WIP Work in Progress other_improvement Not a bug, new feature, refactor, or documentation, e.g. making code more clear labels Jan 30, 2023
sdaulton added a commit to sdaulton/botorch that referenced this issue Feb 8, 2023
Summary:
Pull Request resolved: pytorch#1616

See pytorch#1614

Differential Revision: D42373368

fbshipit-source-id: 8a297e8fdfe3e237397a62acca556219ccd5c959
sdaulton added a commit to sdaulton/botorch that referenced this issue Feb 15, 2023
Summary:
Pull Request resolved: pytorch#1616

See pytorch#1614

Reviewed By: Balandat

Differential Revision: D42373368

fbshipit-source-id: eace05709a824f16a6dfdac0e13d906cc5f8dfd1
facebook-github-bot pushed a commit that referenced this issue Feb 15, 2023
Summary:
Pull Request resolved: #1616

See #1614

Reviewed By: Balandat

Differential Revision: D42373368

fbshipit-source-id: b8c824bc0752c96232ed4a9a29ddcc95a2355c86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
other_improvement Not a bug, new feature, refactor, or documentation, e.g. making code more clear WIP Work in Progress
Projects
None yet
Development

No branches or pull requests

5 participants