luost26 / DMRDenoise

:snowman: Differentiable Manifold Reconstruction for Point Cloud Denoising (ACM MM 2020)
MIT License
118 stars 16 forks source link

About the training loss #19

Open 2410183509 opened 1 year ago

2410183509 commented 1 year ago

Dear author Thanks for sharing the code. I'm currently try to implemente you DMR model in my own dataset. In your ACM MM2020 paper, the training loss is calculated according to the downsampled and the upsampled point cloud. But in your implementation, the loss may calculated only according to the final upsampled point cloud. The part of the code in 'models/denoise.py' line 114 is as follwos:

def training_step(self, batch, batch_idx):
        denoised = self.forward(batch['pos'])
        noiseless = batch['clean']
        normals = batch['normal']

        loss = self.model.get_loss(gts=noiseless, preds=denoised, normals=normals, inputs=batch['pos'])

        output = {
            'loss': loss,
            'log': {
                'loss_train/loss': loss.sum(),
            }
        }
        return output

where this part of code is used for one train forward iteration and the variable 'loss' is the training loss. However, when I turn to the defination of function 'self.model.getloss()' in line 119 as follows:

def get_loss(self, gts, normals, inputs, **kwargs):
        loss = self.loss_rec(preds=self.preds, gts=gts, normals=normals, inputs=inputs, epoch=self.epoch)
        if self.loss_ds is not None:
            loss = loss + self.loss_ds(preds=self.preds, gts=gts, normals=normals, inputs=inputs, epoch=self.epoch)
        return loss

where the loss is calculated using 'self.loss_rec()' and 'self.loss_ds'. The parameters of the function are the same and the only useful parameter is the 'preds' and 'gts' representing the predicted point cloud and the ground truth point cloud. But both of the parameter 'preds' is assigned by 'self.preds' where this is the final upsampled point cloud while the 'self.adjusted' in 'models/net.py' line 58 representing the downsampled point cloud. I wonder if the parameter 'preds' in 'self.loss_rec' should be assigned by 'self.adjusted'. So I would like to ask if there is anything that is inconsistent with the implementation in the paper or something that I didn't notice or misunderstood.

gaoxlAC commented 4 months ago

Hello, do you know how to make the training set for this model (DMRDenoise)? Especially the calculation method of point cloud normal vectors. I am very eager to know your answer, thank you.