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

Add CMBF model #217

Merged
merged 16 commits into from
Jun 23, 2022
Merged

Add CMBF model #217

merged 16 commits into from
Jun 23, 2022

Conversation

yangxudong
Copy link
Collaborator

No description provided.

@@ -300,7 +322,7 @@ def _build_distribute_metric_impl(self,
else:
raise ValueError('Wrong class number')
elif metric.WhichOneof('metric') == 'gauc':
assert loss_type == LossType.CLASSIFICATION
assert loss_type in [LossType.CLASSIFICATION, LossType.F1_REWEIGHTED_LOSS, LossType.PAIR_WISE_LOSS]
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个有没有更好的方式来实现,这样每次新加一个 loss 函数,都需要在每个 metric 下面都加一下,感觉有点繁琐

Copy link
Collaborator Author

@yangxudong yangxudong Jun 21, 2022

Choose a reason for hiding this comment

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

嗯,已经修改了

attention_probs_dropout_prob=self._model_config.attention_probs_dropout_prob,
name='text_self_attention'
) # shape: [batch_size, txt_seq_length, hidden_size]
print('txt_attention_fea:', txt_attention_fea.shape)
Copy link
Collaborator

Choose a reason for hiding this comment

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

print 可以改成 logging 好像更合适一点

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

print打印在stdout,比较清晰地查看;如果用logging在打印在stderr,stderr里面有很多系统输出,日志量非常大,不容易发现需要被注意的关键信息。

@@ -27,7 +27,7 @@ def __init__(self,
labels, is_training)
self._loss_type = self._model_config.loss_type
self._num_class = self._model_config.num_class

self._losses = self._model_config.losses
Copy link
Collaborator

Choose a reason for hiding this comment

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

为什么不能用 self._losses 而要额外定义一个 self._losses

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

losses是为了支持同时使用多个损失函数,而且可以为每个损失函数配置不同的相对权重。

easy_rec/version.py Outdated Show resolved Hide resolved
@@ -71,6 +71,8 @@ message FeatureConfig {

// delimeter to separate sequence multi-values
optional string seq_multi_sep = 101;
// truncate sequence data to max_seq_len
optional uint32 max_seq_len = 102;
Copy link
Collaborator

Choose a reason for hiding this comment

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

序列特征不需要这一个值,可以自动算出来的

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

这个值是用来截断序列的,如果序列长度很大,则后续模型的计算量会很大。

@github-actions
Copy link

CI PY3 Test Failed

@github-actions
Copy link

CI Test Failed

@github-actions
Copy link

CI PY3 Test Failed

@github-actions
Copy link

CI Test Failed

@github-actions
Copy link

CI PY3 Test Failed

@github-actions
Copy link

CI Test Failed

@github-actions
Copy link

CI Test Passed

@github-actions github-actions bot added ci_test_passed ci test passed and removed ci_test_passed ci test passed labels Jun 22, 2022
@github-actions
Copy link

CI Test Passed

@github-actions github-actions bot added ci_test_passed ci test passed and removed ci_test_passed ci test passed labels Jun 22, 2022
@github-actions
Copy link

CI PY3 Test Passed

@github-actions
Copy link

CI PY3 Test Failed

@github-actions
Copy link

CI Test Passed

@github-actions github-actions bot added ci_test_passed ci test passed and removed ci_test_passed ci test passed labels Jun 22, 2022
@github-actions
Copy link

CI PY3 Test Passed

@github-actions
Copy link

CI PY3 Test Passed

@github-actions
Copy link

CI Test Passed

@github-actions github-actions bot added ci_test_passed ci test passed and removed ci_test_passed ci test passed labels Jun 23, 2022
#
# @unittest.skipIf(gl is None, 'graphlearn is not installed')
# def test_dssm_neg_sampler_v2(self):
# self._success = test_utils.test_single_train_eval(
Copy link
Collaborator

Choose a reason for hiding this comment

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

these unit tests should not be removed.

@yangxudong yangxudong merged commit e56c838 into master Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants