deepmodeling / deepmodeling/DeePTB

[Code scan] Fix none embedding constructor and node output property

Open Beginner friendly
#355 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
122
Forks
36
PR merge metrics
No merged PRs in 30d

Description

This issue is part of a Codex global repository scan.

Problem:
The `Embedding(method="none")` implementation calls `torch.nn.Module.__init__` with extra arguments. It also exposes `out_note_dim` instead of `out_node_dim`, while `NNENV` reads `self.embedding.out_node_dim` when building SKTB prediction layers.

Code references:
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/nn/embedding/identity.py#L8-L24
https://github.com/deepmodeling/deeptb/blob/86c60c73996f0dd961c3138f2e88424382cb734e/dptb/nn/deeptb.py#L131-L143

Impact:
The `none` embedding path fails during model construction, and would still fail later with `AttributeError` even after the constructor is fixed.

Suggested fix:
Call `super().__init__()` without extra arguments and rename/add the property as `out_node_dim`.

Contributor guide

Open the contributing guide

Research direction

Read dptb/nn/embedding/identity.py and dptb/nn/deeptb.py at the referenced sections, then trace the none embedding path during model construction. Done means that path constructs successfully and NNENV can read the node output dimension when building SKTB prediction layers.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.