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 into
mhof_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 into
mhof_devfrom
mhof_dev_vector_ki_gain

Conversation

@smilesun

Copy link
Copy Markdown
Collaborator

No description provided.

@smilesun
smilesun changed the base branch from master to mhof_devOctober 4, 2024 14:50
@smilesun
smilesun requested a review from ntchenOctober 4, 2024 14:50
@smilesunsmilesun self-assigned this Oct 4, 2024
@smilesunsmilesun 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
CollaboratorAuthor

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
CollaboratorAuthor

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
CollaboratorAuthor

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
CollaboratorAuthor

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.

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

Labels

enhancementNew feature or requestin progressmajor upgradepriorityFurther information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@smilesun