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

Shape of inputs to SpearmanLoss? #3

Open
visrra opened this issue Jan 29, 2021 · 0 comments
Open

Shape of inputs to SpearmanLoss? #3

visrra opened this issue Jan 29, 2021 · 0 comments

Comments

@visrra
Copy link

visrra commented Jan 29, 2021

What are the expected shapes of the inputs to the forward function of SpearmanLoss? Does it accept batch data?

I think the SpearmanLoss's forward method may have to be modified to support batch input. E.g.
`
def forward(self, mem_pred, mem_gt, pr=False):
rank_gt = get_rank(mem_gt, -1)

    if len(mem_pred.shape) == 1:
        rank_pred = self.sorter(mem_pred.unsqueeze(
            0)).view(-1)
    else:
        rank_pred = self.sorter(mem_pred)
        
    return self.criterion_mse(rank_pred, rank_gt) + self.lbd * self.criterionl1(mem_pred, mem_gt)

`

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