Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Zhenyu2Liang
Copy link
Collaborator

Description

  • Update docstring of MOEAs.
  • Fix bug in RVEA related to vmap. The error occurs when using vmap with operations that involve .item(), as vmap doesn't support reducing a tensor to a scalar. This happened because num_valid was treated as a scalar, leading to an .item() call. To fix this, num_valid was replaced with self.pop_size in torch.randint, and a modulo (% num_valid) was applied to ensure the generated random integers remain within the valid range. This avoids reducing the tensor to a scalar and resolves the vmap error.

Checklist

  • I have formatted my Python code with ruff.
  • I have good commit messages.
  • If adding new algorithms, problems, operators:
    • Added related test cases.
    • Added docstring to explain important parameters.
    • Added entries in the docs.

…ch-dev-lzy

# Conflicts:
#	src/evox/algorithms/__init__.py
#	src/evox/algorithms/mo/__init__.py
#	unit_test/algorithms/test_moea.py
…ch-dev-lzy

# Conflicts:
#	src/evox/algorithms/__init__.py
@BillHuang2001 BillHuang2001 merged commit ccc0feb into main Mar 31, 2025
5 checks passed
XU-Boqing pushed a commit that referenced this pull request Apr 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants