Skip to content

feature(zc): add plan diffuser #700

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

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ding/entry/serial_entry_offline.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def serial_pipeline_offline(
evaluator_env.seed(cfg.seed, dynamic_seed=False)
set_pkg_seed(cfg.seed, use_cuda=cfg.policy.cuda)
policy = create_policy(cfg.policy, model=model, enable_field=['learn', 'eval'])
if cfg.policy.collect.data_type == 'diffuser_traj':
policy.init_data_normalizer(dataset.normalizer)

if hasattr(policy, 'set_statistic'):
# useful for setting action bounds for ibc
Expand Down
629 changes: 629 additions & 0 deletions ding/model/template/diffusion.py

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions ding/policy/command_mode_policy_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
from .bdq import BDQPolicy
from .bcq import BCQPolicy
from .edac import EDACPolicy
from .plan_diffuser import PDPolicy


class EpsCommandModePolicy(CommandModePolicy):
Expand Down Expand Up @@ -398,6 +399,10 @@ class BCQCommandModelPolicy(BCQPolicy, DummyCommandModePolicy):
class EDACCommandModelPolicy(EDACPolicy, DummyCommandModePolicy):
pass

@POLICY_REGISTRY.register('pd_command')
class PDCommandModelPolicy(PDPolicy, DummyCommandModePolicy):
pass


@POLICY_REGISTRY.register('bc_command')
class BCCommandModePolicy(BehaviourCloningPolicy, DummyCommandModePolicy):
Expand Down
392 changes: 392 additions & 0 deletions ding/policy/plan_diffuser.py

Large diffs are not rendered by default.

Loading