Conversation
…change) in cal_reg_loss
| """ | ||
| 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)} |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
OrderedDict preserves the order in which items are inserte, so the same as dicitonary here
There was a problem hiding this comment.
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.
No description provided.