Skip to content

Something Wrong in the "hardloss"? #36

@cvchanghao

Description

@cvchanghao

` hard_loss = 0

    for i in range(real_batch_size):
        confidance_gt = ground_truth_point[i, 0, :, :]
        confidance_gt = confidance_gt.view(1, self.p.grid_y, self.p.grid_x)
        hard_loss =  hard_loss +\
            torch.sum( (1-confidance[i][confidance_gt==1])**2 )/\
            (torch.sum(confidance_gt==1)+1)

        target = confidance[i][confidance_gt==0]
        hard_loss =  hard_loss +\
			torch.sum( ( target[target>0.01] )**2 )/\
			(torch.sum(target>0.01)+1)

        node = hard_sampling.sampling_node(loss = hard_loss.cpu().data, data = data_list[i], previous_node = None, next_node = None)
        self.hard_sampling.insert(node)

you add the hardloss along batches, and insert every single node use the added loss.
Is it right? Maybe should not use the added loss

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions