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

Under OrdinalModule #5

Open
jaideep11061982 opened this issue Jun 16, 2020 · 3 comments
Open

Under OrdinalModule #5

jaideep11061982 opened this issue Jun 16, 2020 · 3 comments

Comments

@jaideep11061982
Copy link

jaideep11061982 commented Jun 16, 2020

Hi could u help understand the below peace of code.
Why do we subtract the elements in linkmat ,then concatinating them .
Isnt just cutpoints-X is sufficient ?

sigmoids=cutpoints-X
 link_mat = sigmoids[:, 1:] - sigmoids[:, :-1]
        link_mat = torch.cat((
                sigmoids[:, [0]],
                link_mat,
                (1 - sigmoids[:, [-1]])
            ),
            dim=1
  1. when does this AscensionCallback gets called up.. start of every batch,epoch,or end of batch or epoch
@EthanRosenthal
Copy link
Owner

The link_mat comes from the middle line of this equation (from my blog post on this)

image

Adjacent cutpoints have to be subtracted from each other.

The AscenscionCallback gets called at the end of every batch.

@jaideep11061982
Copy link
Author

jaideep11061982 commented Jun 17, 2020

NOt sure why but my loss keeps circulating around few values so model dsn converges

self.link = LogisticCumulativeLink1(6,
                                           init_cutpoints='ordered')
def forward(self,  x):
     
       x = self.enc(x)
      
       x = self.head(x) # it output dim is 1 
       x=self.link(x)
       
     
       return x

loss=CumulativeLinkLoss()

@EthanRosenthal
Copy link
Owner

Sorry I can't really help debug -- it could have something to do with the library or be something else. Perhaps you can try training as a regular regression model to see if you can fit that. If you can, then maybe it's something to do with ordinal regression, specifically.

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

2 participants