Comments (5)
I think the model itself is a bit problematic, e.g. an observation of 5 may be provided to a distribution like binomial(4, 0.5), where the log-density would be -Infinity. I've managed to "resolve" this by using a normal distribution rather than a Binomial one. I wonder if there's a way to not have to do this; anyway, I really appreciate the help, thanks again.
from gen.jl.
Ah yes, if your observations have support over all the positive integers and zero, then binomial is not a great choice for the observation noise distribution! Doing inference assuming a binomial would require some solving a non-trivial constraint satisfaction problem, e.g. given that the observation was 5 at timestep 6, what possible sequence of dX
s could have been sampled, such that the problem of observing 5 was non-zero?
Black-box VI can't automatically solve that problem for you -- though I believe traditional forward-backward HMM algorithms should be able to, because they enumerate over all possibilities!
from gen.jl.
Incidentally, there is some specialized code in this Gen extension library that I believe supports the forward-backward algorithm for HMMs --- I believe it assumes that the model has no continuous variables, but you may be able to use it within a larger model to estimate the parameters that you're interested in!
https://github.com/probcomp/GenVariableElimination.jl
from gen.jl.
Hi @min-nguyen! I don't think there's an easy way to enforce constraints directly -- that would probably require a constrained optimization / gradient descent algorithm that we don't currently have implemented.
Have you considered parameterizing your guide distribution in terms of the log of the parameter you care about instead? For example:
@gen function hmmGuide(T::Int)
@param log_trans_p_a
@param log_trans_p_b
@param log_obs_p_a
@param log_obs_p_b
trans_p = @trace(beta(exp(log_trans_p_a), exp(log_trans_p_b)), :trans_p)
obs_p = @trace(beta(exp(log_obs_p_a), exp(log_obs_p_b)), :obs_p)
end
I'm pretty sure this should avoid the issues you're running into, though I can't be certain without trying myself!
from gen.jl.
Ah that makes perfect sense, thanks! Unfortunately, I still run into the same error; I'm very confused.
I've tried using the same exp
pattern in the model itself, as well as changing the init_params
to larger floats.
I think this is originating from the objective becoming negative infinity.
est objective: -Inf
from gen.jl.
Related Issues (20)
- Update test cases to prevent platform-specific variability
- Documentation Github job is skipping deployment to gh-pages on merge to master HOT 14
- Fixing failing doctests found by Documenter.jl
- Move docs from "gen.dev" to "gen.dev/docs" HOT 3
- Simplified import from `Distributions.jl` HOT 2
- Bug in `logpdf_grad` implementation of `@dist` DSL distributions. HOT 1
- Missing visualization/regression_viz.jl HOT 1
- Type signature of HeterogeneousMixture HOT 1
- When should one use Gen.jl over other PPLs such as pyro or PyMC? HOT 3
- Incorrect Dynamic DSL `update` Implementation on the Prox Base Branch HOT 7
- Create new tagged release HOT 4
- Error in documentation of `regenerate`? HOT 1
- Error in `discard` returned by `update` for DynamicDSLTrace with hierarchical addresses HOT 3
- SMC likelihood tempering?
- `_from_array` impl for vector doesn't handle nested elements HOT 2
- Gen.set_submap! breaks for non-`DynamicChoiceMap` submaps HOT 2
- `Gen.choicemap` constructor assigns choice-map args as leaves HOT 2
- [Proposal] Adding an optional serialization dependency.
- Failing docstring tests in Julia nightly.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gen.jl.