|
26 | 26 | ##============================================================================== |
27 | 27 |
|
28 | 28 |
|
| 29 | + |
| 30 | +# """ |
| 31 | +# $SIGNATURES |
| 32 | + |
| 33 | +# Build an approximate density `[Y|X,DX,.]=[X|Y,DX][DX|.]` as proposed by the conditional convolution. |
| 34 | + |
| 35 | +# Notes |
| 36 | +# - Assume both are on circular manifold, `manikde!(pts, (:Circular,))` |
| 37 | +# """ |
| 38 | +# function approxConvCircular(pX::ManifoldKernelDensity, |
| 39 | +# pDX::ManifoldKernelDensity; N::Int=100) |
| 40 | +# # |
| 41 | + |
| 42 | +# # building basic factor graph |
| 43 | +# tfg = initfg() |
| 44 | +# addVariable!(tfg, :s1, Sphere1) |
| 45 | +# addVariable!(tfg, :s2, Sphere1) |
| 46 | +# addFactor!(tfg, [:s1;:s2], Sphere1Sphere1(pDX), graphinit=false) |
| 47 | +# initManual!(tfg,:s1, pX) |
| 48 | + |
| 49 | +# # solve for outgoing proposal value |
| 50 | +# approxConv(tfg,:s1s2f1,:s2) |
| 51 | +# end |
| 52 | + |
| 53 | +# function approxConvCircular(pX::ManifoldKernelDensity, |
| 54 | +# pDX::SamplableBelief; N::Int=100) |
| 55 | +# # |
| 56 | +# pts = reshape(rand(pDX, N), 1, :) |
| 57 | +# pC = manikde!(pts, Sphere1) |
| 58 | +# approxConvCircular(pX, pC) |
| 59 | +# end |
| 60 | + |
| 61 | + |
| 62 | +# function approxConvCircular(pX::SamplableBelief, |
| 63 | +# pDX::ManifoldKernelDensity; N::Int=100) |
| 64 | +# # |
| 65 | +# pts = reshape(rand(pX, N), 1, :) |
| 66 | +# pC = manikde!(pts, Sphere1) |
| 67 | +# approxConvCircular(pC, pDX) |
| 68 | +# end |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +@deprecate printGraphSummary(dfg::AbstractDFG, logger=ConsoleLogger()) show(logger.stream, MIME("text/plain"), dfg) |
| 73 | +@deprecate printSummary(dfg::AbstractDFG, logger=ConsoleLogger()) show(logger.stream, MIME("text/plain"), dfg) |
| 74 | + |
| 75 | + |
| 76 | +# """ |
| 77 | +# $SIGNATURES |
| 78 | + |
| 79 | +# Print basic summary of graph to `logger=ConsoleLogger()`. |
| 80 | +# """ |
| 81 | +# function printGraphSummary(dfg::G, logger=ConsoleLogger())::Nothing where {G <: AbstractDFG} |
| 82 | +# vars = ls(dfg) |
| 83 | +# fcts = lsf(dfg) |
| 84 | + |
| 85 | +# prio = lsfPriors(dfg) |
| 86 | + |
| 87 | +# isinit = map(x->isInitialized(dfg,x), vars) |
| 88 | +# infdim = map(x->getVariableInferredDim(dfg, x), vars) |
| 89 | +# numedges = map(v->length(ls(dfg, v)), vars) |
| 90 | +# numfed = map(fc->length(ls(dfg, fc)), fcts) |
| 91 | +# vardims = map(v->getDimension(getVariable(dfg, v)), vars) |
| 92 | +# fctdims = map(v->getDimension(getFactor(dfg, v)), fcts) |
| 93 | +# priodims = map(v->getDimension(getFactor(dfg, v)), prio) |
| 94 | + |
| 95 | +# with_logger(logger) do |
| 96 | +# @info "Distributed Factor Graph summary:" |
| 97 | +# @info " num variables: $(length(vars))" |
| 98 | +# @info " num factors: $(length(fcts)), w/ $(length(prio)) priors" |
| 99 | +# @info " var initialized: $(sum(isinit))" |
| 100 | +# @info "" |
| 101 | +# @info " var num edges: min. $(minimum(numedges)) | mean $(round(Statistics.mean(numedges),digits=2)) | 90% $(round(quantile(numedges,0.9),digits=2)) | max. $(maximum(numedges))" |
| 102 | +# @info " fct num edges: min. $(minimum(numfed)) | mean $(round(Statistics.mean(numfed),digits=2)) | 90% $(round(quantile(numfed,0.9),digits=2)) | max. $(maximum(numfed))" |
| 103 | +# @info " Variable dims: min. $(minimum(vardims)) | mean $(round(Statistics.mean(vardims),digits=2)) | 90% $(round(quantile(vardims,0.9),digits=2)) | max. $(maximum(vardims))" |
| 104 | +# @info " Factor dims: min. $(minimum(fctdims)) | mean $(round(Statistics.mean(fctdims),digits=2)) | 90% $(round(quantile(fctdims,0.9),digits=2)) | max. $(maximum(fctdims))" |
| 105 | +# @info " Prior dimens: min. $(minimum(priodims)) | mean $(round(Statistics.mean(priodims),digits=2)) | 90% $(round(quantile(priodims,0.9),digits=2)) | max. $(maximum(priodims))" |
| 106 | +# @info " var infr'dims: min. $(minimum(infdim)) | mean $(round(Statistics.mean(infdim),digits=2)) | 90% $(round(quantile(infdim,0.9),digits=2)) | max. $(maximum(infdim))" |
| 107 | +# end |
| 108 | +# nothing |
| 109 | +# end |
| 110 | + |
| 111 | +# """ |
| 112 | +# $SIGNATURES |
| 113 | + |
| 114 | +# Print basic summary of graph to `logger=ConsoleLogger()`. |
| 115 | +# """ |
| 116 | +# function printSummary(dfg::G, logger=ConsoleLogger()) where G <: AbstractDFG |
| 117 | +# printGraphSummary(dfg, logger) |
| 118 | +# end |
| 119 | + |
| 120 | + |
| 121 | + |
29 | 122 | # """ |
30 | 123 | # $SIGNATURES |
31 | 124 |
|
|
0 commit comments