MCPcopy Create free account
hub / github.com/BrainCoTech/RevoLab / _build_full_config

Function _build_full_config

scripts/hora/train.py:100–133  ·  view source on GitHub ↗
(seed: int)

Source from the content-addressed store, hash-verified

98}
99
100def _build_full_config(seed: int):
101 cfg_path = (
102 REPO_ROOT
103 / "source"
104 / "BrainCo_DexHand"
105 / "BrainCo_DexHand"
106 / "tasks"
107 / "direct"
108 / "hora_rotation"
109 / "agents"
110 / f"{args.train_cfg}.yaml"
111 )
112 train_cfg = OmegaConf.load(str(cfg_path))
113 train_cfg.algo = args.algo
114 train_cfg.load_path = os.path.abspath(args.checkpoint) if args.checkpoint else ''
115 train_cfg.ppo.output_name = args.output_name
116 minibatch = train_cfg.ppo.minibatch_size
117 min_envs = minibatch // train_cfg.ppo.horizon_length
118 if not args.test and (args.num_envs < min_envs or (args.num_envs * train_cfg.ppo.horizon_length) % minibatch != 0):
119 raise ValueError(
120 f"num_envs ({args.num_envs}) must be >= {min_envs} and num_envs*horizon must be divisible "
121 f"by minibatch_size ({minibatch}). Valid num_envs: {', '.join(str(i) for i in range(min_envs, 20000, min_envs))}..."
122 )
123 train_cfg.ppo.num_actors = args.num_envs
124 train_cfg.ppo.priv_info = True
125 train_cfg.ppo.proprio_adapt = args.algo == 'ProprioAdapt'
126
127 rl_device = getattr(args, 'device', None) or 'cuda:0'
128 return OmegaConf.create({
129 'rl_device': rl_device,
130 'test': args.test,
131 'seed': seed,
132 'train': train_cfg,
133 })
134
135
136def _build_env_cfg(seed: int):

Callers 1

mainFunction · 0.85

Calls 2

loadMethod · 0.80
createMethod · 0.80

Tested by

no test coverage detected