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 hpt model and corresponding examples. #839

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

luodi-7
Copy link

@luodi-7 luodi-7 commented Nov 27, 2024

Description

Added HPT to ding.model.template, which calls PolicyStem. the model can be used to replace network structures. A replacement example is in lunarlander_hpt_example.py.

Related Issue

TODO

Check List

  • merge the latest version source branch/repo, and resolve all the conflicts
  • pass style check
  • pass all the tests

from .bcq import BCQ
from .edac import EDAC
from .qgpo import QGPO
from .ebm import EBM, AutoregressiveEBM
from .havac import HAVAC
from .policy_stem import PolicyStem
Copy link
Member

Choose a reason for hiding this comment

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

merge policy_stem into hpt

class HPT(nn.Module):
def __init__(self, state_dim, action_dim):
super(HPT, self).__init__()
# 初始化 Policy Stem
Copy link
Member

Choose a reason for hiding this comment

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

add English comments

from ding.utils.registry_factory import MODEL_REGISTRY
from ding.model.template.policy_stem import PolicyStem
@MODEL_REGISTRY.register('hpt')
class HPT(nn.Module):
Copy link
Member

Choose a reason for hiding this comment

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

add paper link and original github repo link to refer others' work


# 检查模型是否在 GPU
for param in model.parameters():
print("模型参数所在设备:", param.device)
Copy link
Member

Choose a reason for hiding this comment

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

use logging.info

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