GPLikelihoods.jl
GPLikelihoods.jl copied to clipboard
`CategoricalLikelihood` should contain the input dimensionality
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?
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.
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
I will just do a PR proposal and we can see if it makes sense
Sorry, yeah, that seems like a good idea.