Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
81c2ead
初次代码提交
2088376133zh Jan 14, 2026
7bfc7fa
提交论文第一章
2088376133zh Jan 15, 2026
b490c72
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng Apr 17, 2026
7483e6a
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng Apr 17, 2026
f07ceaf
初始化项目,上传基础文件
2088376133zh Apr 17, 2026
1114ad6
添加依赖配置与环境说明
2088376133zh Apr 18, 2026
3702d52
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng Apr 19, 2026
99653f8
更改文件夹名称
2088376133zh Apr 19, 2026
adc7ed1
添加生物力学肌肉双臂模型与XML文件
2088376133zh Apr 19, 2026
2046276
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng Apr 19, 2026
05babf0
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng Apr 19, 2026
285d64e
添加代码修改文件名
2088376133zh Apr 19, 2026
3a74583
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng Apr 22, 2026
2d0de79
删除旧文件并更新项目结构
2088376133zh Apr 22, 2026
a8a588b
提交代码文件
2088376133zh Apr 22, 2026
83fdb97
修改文件夹
2088376133zh Apr 22, 2026
481b33d
提交代码文件
2088376133zh Apr 22, 2026
d7d9dda
修改文件
2088376133zh Apr 22, 2026
63b9d5f
重新提交代码文件
2088376133zh Apr 22, 2026
4e961dc
分批上次代码文件
2088376133zh Apr 22, 2026
afd3b6f
部分
2088376133zh Apr 22, 2026
f361622
删除
2088376133zh Apr 22, 2026
f9fb3f7
提交代码
2088376133zh Apr 22, 2026
863961a
分批
2088376133zh Apr 22, 2026
e96cdcd
删除
2088376133zh Apr 22, 2026
06fb33d
代码
2088376133zh Apr 22, 2026
72dd0c2
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng Apr 24, 2026
c833d3b
提交
2088376133zh Apr 24, 2026
3c7f398
提交部分
2088376133zh Apr 24, 2026
6e536de
重新交
2088376133zh Apr 24, 2026
491d38b
提交部分
2088376133zh Apr 24, 2026
b3051e7
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng Apr 27, 2026
a9920ea
提交修改的代码
2088376133zh Apr 27, 2026
3862b2b
提交修改代码
2088376133zh Apr 27, 2026
0bf7afd
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng Apr 28, 2026
9a10e8c
修改不必要的提交
2088376133zh Apr 28, 2026
6b7f7e8
Merge branch 'master' of https://github.com/ZH1024-Heng/sim
2088376133zh Apr 28, 2026
ba9859e
提交修改
2088376133zh Apr 28, 2026
f29a394
提交修改
2088376133zh Apr 28, 2026
0826c22
1
2088376133zh Apr 28, 2026
d8363e9
提交模型文件和代码
2088376133zh Apr 28, 2026
09f0a6d
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng Apr 29, 2026
0f5517f
提交代码
2088376133zh Apr 30, 2026
466479f
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng May 5, 2026
b8c7795
添加模块文件
2088376133zh May 5, 2026
0951084
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng May 6, 2026
e61f953
提交文件
2088376133zh May 6, 2026
3c846b5
更改文件
2088376133zh May 6, 2026
32c9e73
Merge branch 'master' of https://github.com/ZH1024-Heng/sim
2088376133zh May 6, 2026
cb4f36f
提交部分代码文件
2088376133zh May 6, 2026
a3b7a42
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng May 7, 2026
66b4d61
添加模型和代码
2088376133zh May 7, 2026
adce73b
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng May 9, 2026
814e60d
提交代码
2088376133zh May 9, 2026
450c146
1
2088376133zh May 9, 2026
3885d51
Merge branch 'master' of https://github.com/ZH1024-Heng/sim
2088376133zh May 9, 2026
9f7bedc
提交代码
2088376133zh May 9, 2026
0083f6e
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng May 10, 2026
76d955d
替换修改论文内容
2088376133zh May 10, 2026
d5d1e24
Merge branch 'master' of https://github.com/ZH1024-Heng/sim
2088376133zh May 10, 2026
892ffc1
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng May 10, 2026
979e1bd
修改
2088376133zh May 10, 2026
b8b9c4f
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng May 11, 2026
c84c5ca
提交代码
2088376133zh May 11, 2026
b8c0b70
Merge branch 'master' of https://github.com/ZH1024-Heng/sim
2088376133zh May 11, 2026
9522ab3
修改
2088376133zh May 11, 2026
60822c0
提交代码
2088376133zh May 11, 2026
a81aa44
1
2088376133zh May 11, 2026
e293094
提交代码
2088376133zh May 11, 2026
1787eaf
Merge branch 'OpenHUTB:master' into master
ZH1024-Heng May 12, 2026
dc095d1
提交代码
2088376133zh May 12, 2026
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
1 change: 1 addition & 0 deletions hci/user-in-the-box/uitb/rl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .sb3.PPO import PPO
40 changes: 40 additions & 0 deletions hci/user-in-the-box/uitb/rl/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from abc import ABC, abstractmethod
import os
import shutil
import inspect
import pathlib

from ..utils.functions import parent_path

class BaseRLModel(ABC):

def __init__(self, **kwargs):
pass

@abstractmethod
def learn(self, wandb_callback):
pass

@classmethod
def clone(cls, simulator_folder, package_name):

# Create 'rl' folder
dst = os.path.join(simulator_folder, package_name, "rl")
os.makedirs(dst, exist_ok=True)

# Copy the rl library folder
src = parent_path(inspect.getfile(cls))
shutil.copytree(src, os.path.join(dst, src.stem), dirs_exist_ok=True)

# Copy this file
base_file = pathlib.Path(__file__)
shutil.copyfile(base_file, os.path.join(dst, base_file.name))

# Copy the file with encoders
encoder_file = os.path.join(base_file.parent, "encoders.py")
shutil.copyfile(encoder_file, os.path.join(dst, "encoders.py"))

# Create an __init__.py file with the relevant import
modules = cls.__module__.split(".")
with open(os.path.join(dst, "__init__.py"), "w") as file:
file.write("from ." + ".".join(modules[2:]) + " import " + cls.__name__)
69 changes: 69 additions & 0 deletions hci/user-in-the-box/uitb/rl/encoders.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from torch import nn
import torch
from typing import final


class BaseEncoder:
""" Defines an encoder. Note that in stable baselines training we only use the model definitions given here. We don't
e.g. after training set the encoder parameters into these objects, but instead use the ones saved/loaded by stable
baselines. In other words, these encoders are not used after during/after training, only to initialise the encoders
for stable baselines. """

def __init__(self, observation_shape, **kwargs):
self._observation_shape = observation_shape

# Define a PyTorch model (e.g. using torch.nn.Sequential)
self._model = None

# We assume all encoders output a vector with self._out_features elements in it
self.out_features = None

@final
@property
def model(self):
return self._model

class Identity(BaseEncoder):
""" Define an identity encoder. Used when no encoder has been defined. Can only be used for one-dimensional
observations. """

def __init__(self, observation_shape):
super().__init__(observation_shape)
if len(observation_shape) > 1:
raise RuntimeError("You must not use the Identity encoder for higher dimensional observations. Use an encoder"
"that maps the high dimensional observations into one dimensional vectors.")
self._model = torch.nn.Identity()
self.out_features = observation_shape[0]

class SmallCNN(BaseEncoder):

def __init__(self, observation_shape, out_features):
super().__init__(observation_shape)
cnn = nn.Sequential(
nn.Conv2d(in_channels=observation_shape[0], out_channels=8, kernel_size=(3, 3), padding=(1, 1), stride=(2, 2)),
nn.LeakyReLU(),
nn.Conv2d(in_channels=8, out_channels=16, kernel_size=(3, 3), padding=(1, 1), stride=(2, 2)),
nn.LeakyReLU(),
nn.Conv2d(in_channels=16, out_channels=32, kernel_size=(3, 3), padding=(1, 1), stride=(2, 2)),
nn.LeakyReLU(),
nn.Flatten())

# Compute shape by doing one forward pass
with torch.no_grad():
n_flatten = cnn(torch.zeros(observation_shape)[None]).shape[1]

self._model = nn.Sequential(
cnn,
nn.Linear(in_features=n_flatten, out_features=out_features),
nn.LeakyReLU())
self.out_features = out_features


class OneLayer(BaseEncoder):

def __init__(self, observation_shape, out_features):
super().__init__(observation_shape)
self.out_features = out_features
self._model = nn.Sequential(
nn.Linear(self._observation_shape[0], out_features),
nn.LeakyReLU())
Loading