Skip to content

Mhof dev vector ki gain: copy changeds from https://github.com/marrlab/DomainLab/pull/772/files mannually#880

Merged
smilesun merged 50 commits intomhof_devfrom
mhof_dev_vector_ki_gain
Oct 17, 2024
Merged

Mhof dev vector ki gain: copy changeds from https://github.com/marrlab/DomainLab/pull/772/files mannually#880
smilesun merged 50 commits intomhof_devfrom
mhof_dev_vector_ki_gain

Conversation

@smilesun
Copy link
Copy Markdown
Collaborator

@smilesun smilesun commented Oct 4, 2024

No description provided.

@smilesun smilesun changed the base branch from master to mhof_dev October 4, 2024 14:50
@smilesun smilesun requested a review from ntchen October 4, 2024 14:50
@smilesun smilesun self-assigned this Oct 4, 2024
@smilesun smilesun added enhancement New feature or request in progress major upgrade priority Further information is requested labels Oct 4, 2024
"""
self.cal_reg_loss_over_task_loss_ratio()
list_mu = self.cal_reg_loss_over_task_loss_ratio()
self.dict_multiplier = {'mu4regloss'+str(i): value for i, value in enumerate(list_mu)}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let each trainer to return string of reg loss name in _cal_reg_loss

enumerate(list_boolean_zero) if not flag]
list_mu = [list_mu[i] for (i, flag) in enumerate(list_boolean_zero) if not flag]
if self.dict_multiplier:
list_mu = list(self.dict_multiplier.values())
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is bad implementation, will list(self.dict_multiplier.values) return the same list order each time? since mhof is updating the self.dict_multiplier, as long as the order each time is the same (even if the order does not agree with the order list_mu) returns.

Alexej suggest to use OrderDictionary

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OrderedDict preserves the order in which items are inserte, so the same as dicitonary here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list(dict.keys()) will return keys in the same order they were inserted each time it's called, as long as the dictionary hasn't been modified.

@smilesun smilesun mentioned this pull request Oct 11, 2024
@smilesun smilesun merged commit 7bcda06 into mhof_dev Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request in progress major upgrade priority Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant