octree-nn / ocnn-pytorch

Octree-based Sparse Convolutional Neural Networks
MIT License
150 stars 16 forks source link

Handling Independence of Octree Data in Batch Processes for Network Input in Reinforcement Learning with OCNN_PyTorch #33

Closed kankannali closed 4 months ago

kankannali commented 4 months ago

I am currently attempting to implement a reinforcement learning task using the OCNN_PyTorch framework. I have noticed that the input to the network created by OCNN includes both features extracted from an octree and the octree itself. In the semantic segmentation example provided in OCNN, I observed the use of ocnn.octree.merge_octrees(octrees) followed by octree.construct_all_neigh() to aggregate a batch of octree data for processing by the network.

My task involves reinforcement learning, where each observation should be independent and not interfere with others. Does the merging operation of octrees still satisfy the requirements for reinforcement learning, where each step's observations are expected to be independent?

Thank you for your assistance.

wang-ps commented 4 months ago

The ocnn.octree.merge_octrees(octrees) is analogous to merging a batch N of images (H, W, C) to a tensor (N, H, W, C). In the segmentation task, the octree is processed independently, even though a batch of octrees is merged.

kankannali commented 4 months ago

I have been working on a project where I collect octree information at each step of the process. Through studying OCNN, I found that the ocnn.octree.merge_octrees(octrees) function efficiently stores octree data within a batch. However, I have encountered a new challenge: I'm wondering if there's an existing API or method to dynamically update octrees?

wang-ps commented 4 months ago

The octree can grow dynamically with new octree split signals. Please refer to https://github.com/octree-nn/ocnn-pytorch/blob/master/ocnn/models/autoencoder.py#L107 I am not sure whether this is what you mean by "dynamically update octrees."

kankanzheli commented 4 months ago

Sorry for any confusion in my previous messages. When I mentioned "dynamically updating octrees," I was referring to the process of merging the octree from a previous step with the point cloud data from the current step to generate an octree that presents a more complete view of the environment. This approach is aimed at incrementally building a comprehensive model of the environment in simulations or experiments, allowing for continuous updates and refinements.

wang-ps commented 4 months ago

merging the octree from a previous step with the point cloud data from the current step to generate an octree that presents a more complete view of the environment.

The codebase does not support this feature currently. I think it is not hard to be implemented .