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

Fixes ensembling with sigmoid #6588

Merged
merged 4 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions monai/apps/auto3dseg/auto_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ def __init__(
self.search_space: dict[str, dict[str, Any]] = {}
self.hpo_tasks = 0

if "sigmoid" not in self.kwargs and "sigmoid" in self.data_src_cfg:
self.kwargs["sigmoid"] = self.data_src_cfg["sigmoid"]

def read_cache(self):
"""
Check if the intermediate result is cached after each step in the current working directory
Expand Down
8 changes: 2 additions & 6 deletions monai/apps/auto3dseg/ensemble_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,14 +586,10 @@ def ensemble(self):
if len(infer_files) == 0:
logger.info("No testing files for inference is provided. Ensembler ending.")
return
infer_files = (
partition_dataset(data=infer_files, shuffle=False, num_partitions=len(infer_files))[self.rank]
if self.rank < len(infer_files)
else []
)
infer_files = [infer_files[self.rank]] if self.rank < len(infer_files) else []
else:
infer_files = partition_dataset(
data=infer_files, shuffle=False, num_partitions=self.world_size, even_divisible=True
data=infer_files, shuffle=False, num_partitions=self.world_size, even_divisible=False
)[self.rank]

# TO DO: Add some function in ensembler for infer_files update?
Expand Down