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

CategoricalLikelihood should contain the input dimensionality #58

Open
theogf opened this issue Dec 16, 2021 · 4 comments
Open

CategoricalLikelihood should contain the input dimensionality #58

theogf opened this issue Dec 16, 2021 · 4 comments

Comments

@theogf
Copy link
Member

theogf commented Dec 16, 2021

I am planning to write a nlatent function for the package, returning the dimensionality of the input needed for the likelihood.
It is very practical to initialize things with a given likelihood.

However, the current version of CategoricalLikelihood has no way of knowing the number of latent needed. what do you think about enforcing the number of outputs in the likelihood?

@theogf theogf changed the title CategoricalLikelihood should contain the number of outputs CategoricalLikelihood should contain the input dimensionality Dec 16, 2021
@willtebbutt
Copy link
Member

I think I would like to see an example of how using this would look with / without this requirement. i.e. what would we currently do, vs what would we do if this data were stored in the likelihood.

@theogf
Copy link
Member Author

theogf commented Mar 9, 2022

I guess something like:

struct CategoricalLikelihood{Tl<:AbstractLink} <: AbstractLikelihood
    nclass::Int
    invlink::Tl
end

CategoricalLikelihood(nclass, l=BijectiveSimplexLink(softmax)) = CategoricalLikelihood(nclass, link(l))

nlatent(l::CategoricalLikelihood) = l.nclass
nlatent(l::CategoricalLikelihood{<:BijectiveSimplexLink}) = l.nclass - 1

Eventually this could be used to check the input dimensionality. But I am more imagining a front end model where you would pass, kernel, likelihood and inference and that it could be automatically inferred how many latent GPs you need

@theogf
Copy link
Member Author

theogf commented Mar 10, 2022

I will just do a PR proposal and we can see if it makes sense

@willtebbutt
Copy link
Member

Sorry, yeah, that seems like a good idea.

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