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

A mean and std computation and use question #33

Open
RobinWitch opened this issue Mar 28, 2024 · 2 comments
Open

A mean and std computation and use question #33

RobinWitch opened this issue Mar 28, 2024 · 2 comments

Comments

@RobinWitch
Copy link

RobinWitch commented Mar 28, 2024

Hello, what a good work!
While I have a question when I retrain rvqvae, it quite diffuse me a lot.
Why in this place we need to recalculate std?

if opt.is_train:
# root_rot_velocity (B, seq_len, 1)
std[0:1] = std[0:1] / opt.feat_bias
# root_linear_velocity (B, seq_len, 2)
std[1:3] = std[1:3] / opt.feat_bias
# root_y (B, seq_len, 1)
std[3:4] = std[3:4] / opt.feat_bias
# ric_data (B, seq_len, (joint_num - 1)*3)
std[4: 4 + (joints_num - 1) * 3] = std[4: 4 + (joints_num - 1) * 3] / 1.0
# rot_data (B, seq_len, (joint_num - 1)*6)
std[4 + (joints_num - 1) * 3: 4 + (joints_num - 1) * 9] = std[4 + (joints_num - 1) * 3: 4 + (
joints_num - 1) * 9] / 1.0
# local_velocity (B, seq_len, joint_num*3)
std[4 + (joints_num - 1) * 9: 4 + (joints_num - 1) * 9 + joints_num * 3] = std[
4 + (joints_num - 1) * 9: 4 + (
joints_num - 1) * 9 + joints_num * 3] / 1.0
# foot contact (B, seq_len, 4)
std[4 + (joints_num - 1) * 9 + joints_num * 3:] = std[
4 + (
joints_num - 1) * 9 + joints_num * 3:] / opt.feat_bias
assert 4 + (joints_num - 1) * 9 + joints_num * 3 + 4 == mean.shape[-1]
np.save(pjoin(opt.meta_dir, 'mean.npy'), mean)
np.save(pjoin(opt.meta_dir, 'std.npy'), std)
self.mean = mean
self.std = std
print("Total number of motions {}, snippets {}".format(len(self.data), self.cumsum[-1]))

@EricGuo5513
Copy link
Owner

EricGuo5513 commented Mar 28, 2024 via email

@RobinWitch
Copy link
Author

In intuitive, I think amplifying the importance of certain motion features we should plus opt.feat_bias instead of dividing? The default value of opt.feat_bias is 5.

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

No branches or pull requests

2 participants