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

新增多任务模型 Dev zsx mtl1 #255

Merged
merged 47 commits into from
Aug 15, 2022
Merged

新增多任务模型 Dev zsx mtl1 #255

merged 47 commits into from
Aug 15, 2022

Conversation

zanshuxun
Copy link
Collaborator

@zanshuxun zanshuxun commented Aug 12, 2022

@codecov
Copy link

codecov bot commented Aug 12, 2022

Codecov Report

Merging #255 (90cae06) into master (2cd84f3) will increase coverage by 0.26%.
The diff coverage is 93.23%.

@@            Coverage Diff             @@
##           master     #255      +/-   ##
==========================================
+ Coverage   92.31%   92.58%   +0.26%     
==========================================
  Files          30       35       +5     
  Lines        2069     2333     +264     
==========================================
+ Hits         1910     2160     +250     
- Misses        159      173      +14     
Flag Coverage Δ
pytest 92.58% <93.23%> (+0.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
deepctr_torch/models/basemodel.py 86.45% <87.50%> (+1.35%) ⬆️
deepctr_torch/models/multitask/esmm.py 90.24% <90.24%> (ø)
deepctr_torch/models/multitask/sharedbottom.py 91.30% <91.30%> (ø)
deepctr_torch/models/multitask/mmoe.py 92.53% <92.53%> (ø)
deepctr_torch/models/multitask/ple.py 95.87% <95.87%> (ø)
deepctr_torch/models/__init__.py 100.00% <100.00%> (ø)
deepctr_torch/models/dcnmix.py 88.37% <100.00%> (ø)
deepctr_torch/models/dien.py 97.23% <100.00%> (ø)
deepctr_torch/models/multitask/__init__.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@@ -70,10 +70,9 @@ def __init__(self, linear_feature_columns,
layer_num=cross_num, device=device)
self.add_regularization_weight(
filter(lambda x: 'weight' in x[0] and 'bn' not in x[0], self.dnn.named_parameters()), l2=l2_reg_dnn)
self.add_regularization_weight(
Copy link
Owner

Choose a reason for hiding this comment

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

通过'_list'来判断参数容易引起后续维护迭代出现问题

filter(lambda x: 'weight' in x[0] and 'bn' not in x[0], self.specific_gate_dnn.named_parameters()),
l2=l2_reg_dnn)
else:
self.specific_gate_dnn_final_layer = nn.ModuleList(
Copy link
Owner

Choose a reason for hiding this comment

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

if else里的self.specific_gate_dnn_final_layer可进一步合并


self.out = nn.ModuleList([PredictionLayer(task) for task in task_types])

self.add_regularization_weight(
Copy link
Owner

Choose a reason for hiding this comment

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

多个正则权重的添加逻辑可以进行优化

@zanshuxun zanshuxun changed the title Dev zsx mtl1 新增多任务模型 Dev zsx mtl1 Aug 12, 2022
'num_experts, expert_dnn_hidden_units, gate_dnn_hidden_units, tower_dnn_hidden_units, task_types, '
'sparse_feature_num, dense_feature_num',
[
(3, (256, 128), (64,), (64,), ['binary', 'binary'], 3, 3),
Copy link
Owner

Choose a reason for hiding this comment

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

几个test文件中的 维度可以调小

@shenweichen shenweichen changed the base branch from master to release August 15, 2022 12:15
@shenweichen shenweichen merged commit 19e09e4 into release Aug 15, 2022
@shenweichen shenweichen deleted the dev-zsx-mtl1 branch October 23, 2022 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants