Comments (9)
Maybe standardize the compiler API for LHS with concrete values, by e.g. introducing a function operate on Julia expressions (which can be called by the @model
macro)? This would allow the user to overload ~
for specific use cases.
from dynamicppl.jl.
Reported by @jonasmac16.
from dynamicppl.jl.
This is an interesting one, but may I ask how is supporting Inf
as data useful?
from dynamicppl.jl.
It's for something like below
res = solve(...)
if res.success
data ~ dist
else
Inf ~ dist
end
from dynamicppl.jl.
Can we achieve the same goal by defining the Impossible
distribution? rand(::Impossible) = NaN
and logpdf(::Impossible, ::Any) = -Inf
.
res = solve(...)
if res.success
data ~ dist
else
data ~ Impossible()
end
Supporting Inf
on the LHS is also possible.
from dynamicppl.jl.
Yes there are maily work aournds for this. Like the one you post or just pass in a data call data_inf
which is Inf
. But it's might be cool for the user to do so easily.
from dynamicppl.jl.
Sounds good.
from dynamicppl.jl.
As discussed in #57 (comment), I think the more natural way to write the example above would be
res = solve(...)
if !res.success
@logpdf() = -Inf
return
end
data ~ dist
So can this issue be closed, @xukai92, or are there other use cases that require a specific fix for Inf
?
from dynamicppl.jl.
It makes sense. The issue was originally rasied by a user in slack. Let's close if for now.
from dynamicppl.jl.
Related Issues (20)
- Decouple from Distributions.jl HOT 8
- ThreadSafeVarInfo(::SimpleVarInfo) bug with ForwardDiff HOT 1
- Need alternative to `NamedTuple` for `SimpleVarInfo` HOT 12
- Storing returned values in `VarInfo`.
- `BangBang.setindex!!(vi::SimpleVarInfo{<:AbstractDict}, val, vn::VarName)` returns eltype Any arrays when `vn` is multidimensional HOT 1
- Remove `tonamedtuple`
- Can't use `@info` in models HOT 1
- Move TestUtils to an extension
- `SimpleVarInfo` sometimes returns a `SimpleVarInfo` with `Int`-type `logp` and creates down-stream errors HOT 1
- Roadmap for removal of `Selector` shenanigans HOT 2
- change defaults: @addlogprob! not included in PriorContext() HOT 5
- Type-instability when using type-parameters HOT 1
- Type instability in unflatten for medium / large tuples HOT 6
- DynamicPPL..jl tests 23 Broken. HOT 3
- Introduce a convenience function, `AutoType`, to hide `TypeWrap`.
- Issue with ReverseDiff and undef on Julia v1.7 HOT 1
- Add an exported function to get variable names for a model
- Replace uage of `typeof` with `Core.Typeof` HOT 2
- `minibatch` / `stochastic_gradient` operation on models HOT 5
- Repeated deriving of `rule` while using Tapir
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 dynamicppl.jl.