-
Notifications
You must be signed in to change notification settings - Fork 2
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
DFGVariable softtype field has abstract type #149
Comments
It might be nice if DFGVariable{T<:AbstractSoftType} also. Then the type data is inherently saved in the variable. |
Hi, yes the lack of type is no good for performance. |
This is why it is blank I thinik, InferenceVariable is in IIF. Thats why the extra layer. |
|
this issue will likely undo some of #148, but at this point I want to stop talking and actually code some stuff. |
not sure why it is in DFGFactor.jl, but not a concern right now. |
Ok, then its not a problem. I didn't think to look in DFGFactor.jl at all. |
yeah, weird location, but probably some good reason somewhere. |
I'll quickly fix issue. |
Unfortunately it would be a breaking change: function addVariable!(dfg::G,
lbl::Symbol,
softtype::T;
N::Int=100,
autoinit::Bool=true, # does init need to be separate from ready? TODO
ready::Int=1,
dontmargin::Bool=false,
labels::Vector{Symbol}=Symbol[],
smalldata=Dict{String, String}(),
checkduplicates::Bool=true )::DFGVariable where
{G <: AbstractDFG,
T <: InferenceVariable}
#
v = DFGVariable(lbl)
#needs to add the parameter or softtype
DFGVariable{T}(lbl)
DFGVariable(lbl, softype) |
Is it ok if i made the milestone 0.5.0? It’s mostly performance and is likely to break a lot of code. Depreciate without fix to use DFGVariable(lbl, softype) in 0.4.x and then break in 0.5.0? |
see #149. I still think making the type parametric will be of advantage since it is used in the core algorithm. |
Towards #149 - Slightly improved without breaking changes.
I'm not too hot on double template here. Single
PPE is not used in the core algorithm, if thats what you are referring too. PPE is for user convenience -- reduction from the marginal belief estimate. |
I don’t know how to do it then. Is the whole DFGVariable not of one type. solverDataDict::Dict{Symbol, VariableNodeData{<:InferenceVariable}} I still don't see the problem with
DFGvariable has an abstract type softtype::Any. It is used everywhere not just for ppe (ppe does not have a softtype field). Or am i missing something? |
Quickly cleaned up and committed what I had so far, see commit: dcd97da |
Bad: solverDataDict::Dict{Symbol, VariableNodeData{<:InferenceVariable}} Which is very different from templating:Good: mutable struct VariableNodeData{T<:InferenceVariable}
...
softtype::T
...
end |
with this:
I meant: the PPE compat design issue is not solved by introducing templating. We argued it out. You would have to change the (now old)
|
Should DFG not export an abstract type with IIF InferenceType inheriting from it? I don't like that it does not have a type. see https://docs.julialang.org/en/v1/manual/performance-tips/#Avoid-fields-with-abstract-type-1
eg.
AbstractSoftType
then in IIFInferenceType <: AbstractSoftType
even
VariableNodeData{T<:Any}
will be better I think.Originally posted by @Affie in https://github.com/_render_node/MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMzMzQxNDkyMQ==/comments/review_comment
The text was updated successfully, but these errors were encountered: