Skip to content

Comments

[feat] backbone#236

Open
czffzc wants to merge 96 commits intoalibaba:masterfrom
czffzc:backbone
Open

[feat] backbone#236
czffzc wants to merge 96 commits intoalibaba:masterfrom
czffzc:backbone

Conversation

@czffzc
Copy link
Collaborator

@czffzc czffzc commented Aug 8, 2025

  • support rank_bakcbone and slight support multi_task_backbone

@CLAassistant
Copy link

CLAassistant commented Aug 8, 2025

CLA assistant check
All committers have signed the CLA.

feature_names: "price"
group_type: DEEP
}
dssm {
Copy link
Collaborator

Choose a reason for hiding this comment

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

clean up all non-modular config & rename component to modular

) -> None:
super().__init__(model_config, features, labels, sample_weights, **kwargs)

# 获取match_backbone配置
Copy link
Collaborator

Choose a reason for hiding this comment

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

use english comments

self._temperature = model_params.temperature

# 也可以从kwargs中获取参数(运行时传入)
self._output_dim = kwargs.get("output_dim", self._output_dim)
Copy link
Collaborator

Choose a reason for hiding this comment

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

should not use kwargs

self._match_backbone_config = self._base_model_config.match_backbone

# 从model_params获取基本参数,设置默认值
model_params = getattr(self._match_backbone_config, "model_params", None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

In the ModularMatch proto, you can now directly define parameters such as output_dim and similarity_type without the need to reference the ModelParams proto. This streamlines the configuration process, ensuring that all relevant parameters are conveniently specified within the ModularMatch proto itself.

self._match_backbone_config = self._base_model_config.match_backbone

# 从model_params获取基本参数,设置默认值
model_params = getattr(self._match_backbone_config, "model_params", None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

When retrieving parameters from the protobuf configuration, avoid using getattr. Instead, access parameters directly using config.param. This approach enhances code clarity and reduces the risk of errors.

return field_type == FieldDescriptor.TYPE_MESSAGE


class Parameter(object):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where do we use Parameter?

)
return input_dim

elif layer_type == "DINEncoder":
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the difference between DIN and DINEncoder?

)
return input_dim

elif layer_type in [
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hard-code all layers?


# infer output dimension
output_dim = lambda_wrapper.infer_output_dim(input_dim)

Copy link
Collaborator

Choose a reason for hiding this comment

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

do not print, use assert

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

sig = inspect.signature(layer_cls.__init__)
kwargs = {}
elif param_type == "st_params":
params = Parameter(layer_conf.st_params, True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Parameter may not be needed, directly use config_to_kwargs?

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.

3 participants