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

Question about leaf nodes unchanged during optimization #106

Open
Yang-Xijie opened this issue Dec 30, 2024 · 2 comments
Open

Question about leaf nodes unchanged during optimization #106

Yang-Xijie opened this issue Dec 30, 2024 · 2 comments

Comments

@Yang-Xijie
Copy link

In paper 5.1 Optimizing the Hierarchy, you mention "we do not change the leaf nodes during optimization." However, I cannot find the according code in train_post.py.


In train_post.py, threshold, the third parameter of expand_to_size(), is set to [0.005, 0.1].

limmax = 0.1
limmin = 0.005

limit = math.pow(2, sample * (math.log2(limmax) - math.log2(limmin)) + math.log2(limmin))
scale = 1

to_render = expand_to_size(
gaussians.nodes,
gaussians.boxes,
limit * scale,
viewpoint_cam.camera_center,
torch.zeros((3)),
render_indices,
parent_indices,
nodes_for_render_indices)

I speculate that limmin helps keep the leaf nodes unchanged. Since the larger the limmin, the lower possibility the leaf nodes will be selected. Is this correct?

@Yang-Xijie
Copy link
Author

I find the following code keeps anchors unchanged.

# Optimizer step
if iteration < opt.iterations:
if gaussians._xyz.grad != None:
if gaussians.skybox_points != 0 and gaussians.skybox_locked: #No post-opt for skybox
gaussians._xyz.grad[-gaussians.skybox_points:, :] = 0
gaussians._rotation.grad[-gaussians.skybox_points:, :] = 0
gaussians._features_dc.grad[-gaussians.skybox_points:, :, :] = 0
gaussians._features_rest.grad[-gaussians.skybox_points:, :, :] = 0
gaussians._opacity.grad[-gaussians.skybox_points:, :] = 0
gaussians._scaling.grad[-gaussians.skybox_points:, :] = 0
gaussians._xyz.grad[gaussians.anchors, :] = 0
gaussians._rotation.grad[gaussians.anchors, :] = 0
gaussians._features_dc.grad[gaussians.anchors, :, :] = 0
gaussians._features_rest.grad[gaussians.anchors, :, :] = 0
gaussians._opacity.grad[gaussians.anchors, :] = 0
gaussians._scaling.grad[gaussians.anchors, :] = 0

However, when I use my own dataset, it seems that nothing exists in anchors.bin: the content of anchors.bin is 0x00000000. In this case, the leaf nodes are still optimized.

@Yang-Xijie
Copy link
Author

related PR: graphdeco-inria/gaussian-hierarchy#1

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

1 participant