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

weight according to initial loss scale #862

Closed
smilesun opened this issue Jul 23, 2024 · 1 comment
Closed

weight according to initial loss scale #862

smilesun opened this issue Jul 23, 2024 · 1 comment
Assignees
Labels
in progress priority Further information is requested urgent

Comments

@smilesun
Copy link
Collaborator

smilesun commented Jul 23, 2024

for each regularization loss, before training start, calculate the ratio of this loss term with respect to the task loss (cross entropy for classiifcaiton)

e.g. regularization loss for DANN is

return [lc_d], [self.alpha]
.

However, we do not need to care about this line above, but rather,

loss_reg = self.list_inner_product(list_loss, list_multiplier)

This issue is to make a feature for DomainLab such that for each loss term, we have a reference ratio of this loss term over the task loss, then the user input gamma_reg will be interpreted as a multiplication factor only on top of this ratio, i.e.
list_multiplier[j]*ratio[j], where j is the index for the loss term in question, ratio is something we have to calculate before training starts, here:

we probalby need to define something like self.list_reg_loss_over_task_loss_ratio in

def __init__(self):

then before

loss_reg = self.list_inner_product(list_loss, list_multiplier)

we do new_list_multiplier= [mtuple[0]*mtuple[1] for mtuple in zip(self.list_reg_loss_over_task_loss_ratio, list_multiplier)]

@smilesun smilesun added priority Further information is requested urgent labels Jul 23, 2024
@smilesun smilesun self-assigned this Jul 24, 2024
@smilesun
Copy link
Collaborator Author

working on a pr #863

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress priority Further information is requested urgent
Projects
None yet
Development

No branches or pull requests

1 participant