From 059c0287357654ac863c5e16ffe6f5037c732dd7 Mon Sep 17 00:00:00 2001 From: Sam Claassens Date: Wed, 23 Mar 2022 07:57:12 -0500 Subject: [PATCH] Fixing up tutorial 2 in Python --- julia/caesar-api/icra-2-nongaussian.ipynb | 313 ++++++++++++++++++++-- 1 file changed, 296 insertions(+), 17 deletions(-) diff --git a/julia/caesar-api/icra-2-nongaussian.ipynb b/julia/caesar-api/icra-2-nongaussian.ipynb index b82117e..cdf37c1 100644 --- a/julia/caesar-api/icra-2-nongaussian.ipynb +++ b/julia/caesar-api/icra-2-nongaussian.ipynb @@ -34,9 +34,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "┌ Info: FunctionalStateMachine.jl is adding Graphs.jl related tools (Visualization).\n", + "└ @ FunctionalStateMachine /home/samc/.julia/packages/FunctionalStateMachine/2JZFG/src/StateMachineAnimation.jl:1\n", + "┌ Info: IncrementalInference.jl is loading tools related to InteractiveUtils.jl.\n", + "└ @ IncrementalInference /home/samc/.julia/packages/IncrementalInference/zwqKk/src/RequireInteractiveUtils.jl:2\n" + ] + } + ], "source": [ "# import Pkg; Pkg.add(Pkg.PackageSpec(name=\"IncrementalInference\", version=\"0.27\"))\n", "using IncrementalInference" @@ -58,9 +69,36 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "\u001b[0m\u001b[1mDFGVariable{\u001b[22m\u001b[34m\u001b[1mPosition\u001b[22m\u001b[39m\u001b[0m\u001b[1m...}\u001b[22m\n", + " manifold: TranslationGroup(1; field = ℝ)\n", + " timestamp: 2022-03-23T07:08:48.944-05:00\n", + " nstime: 0 nanoseconds\n", + " label: \u001b[0m\u001b[1mx0\u001b[22m\n", + " solvable: 1\n", + " tags: Set([:VARIABLE])\n", + "\u001b[0m\u001b[1m # VND solveKeys= (1)\u001b[22m\n", + "\u001b[0m\u001b[1m # initialized: \u001b[22m(true=0,false=1)\n", + "\u001b[0m\u001b[1m # marginalized: \u001b[22m(true=0,false=1)\n", + " :default <-- VariableNodeData\n", + " initilized: false\n", + " marginalized: false\n", + " size bel. samples: (100,)\n", + " kde bandwidths: 0.0\n", + "\u001b[0m\u001b[1m VNDs: \u001b[22m[:default]\n", + "\u001b[0m\u001b[1m # PPE solveKeys= (0)\u001b[22m\n", + "\u001b[34m\u001b[1m VariableType: \u001b[22m\u001b[39mPosition{1}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "# Start with an empty factor graph\n", "fg = initfg()\n", @@ -82,9 +120,37 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mtry doautoinit! of x0\n" + ] + }, + { + "data": { + "text/plain": [ + "\u001b[0m\u001b[1mDFGFactor{CommonConvWrapper{\u001b[22m\u001b[34m\u001b[1mPrior\u001b[22m\u001b[39m\u001b[0m\u001b[1m...}}\u001b[22m\n", + " timestamp: 2022-03-23T07:09:15.297-05:00\n", + " nstime: 0 nanoseconds\n", + " label: \u001b[0m\u001b[1mx0f1\u001b[22m\n", + " solvable: 1\n", + " VariableOrder: [:x0]\n", + " multihypo: Float64[]\n", + " nullhypo: 0.0\n", + " tags: Set([:FACTOR])\n", + "\u001b[34m\u001b[1m FactorType: \u001b[22m\u001b[39mPrior{Normal{Float64}}\n", + "\u001b[35mZ:\u001b[39m\n", + "Normal{Float64}(μ=0.0, σ=1.0)\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "# this is unary (prior) factor and does not immediately trigger autoinit of :x0.\n", "addFactor!(fg, [:x0], Prior(Normal(0,1)))" @@ -129,9 +195,54 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mtry doautoinit! of x0\n", + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39minit with useinitfct [:x0f1]\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mdo init of x0\n", + "┌ Warning: updateVariableSolverData with solveKey parameter might change in the future, see DFG #565. Future warnings are suppressed\n", + "└ @ DistributedFactorGraphs /home/samc/.julia/packages/DistributedFactorGraphs/ttnFL/src/services/DFGVariable.jl:658\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mtry doautoinit! of x1\n" + ] + }, + { + "data": { + "text/plain": [ + "\u001b[0m\u001b[1mDFGFactor{CommonConvWrapper{\u001b[22m\u001b[34m\u001b[1mLinearRelative\u001b[22m\u001b[39m\u001b[0m\u001b[1m...}}\u001b[22m\n", + " timestamp: 2022-03-23T07:09:30.122-05:00\n", + " nstime: 0 nanoseconds\n", + " label: \u001b[0m\u001b[1mx0x1f1\u001b[22m\n", + " solvable: 1\n", + " VariableOrder: [:x0, :x1]\n", + " multihypo: Float64[]\n", + " nullhypo: 0.0\n", + " tags: Set([:FACTOR])\n", + "\u001b[34m\u001b[1m FactorType: \u001b[22m\u001b[39mLinearRelative{1, Normal{Float64}}\n", + "\u001b[35mZ:\u001b[39m\n", + "Normal{Float64}(μ=10.0, σ=1.0)\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "addVariable!(fg, :x1, ContinuousScalar)\n", "# P(Z | :x1 - :x0 ) where Z ~ Normal(10,1)\n", @@ -192,9 +303,53 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mtry doautoinit! of x1\n", + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39minit with useinitfct [:x0x1f1]\n", + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mdo init of x1\n", + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mtry doautoinit! of x2\n" + ] + }, + { + "data": { + "text/plain": [ + "\u001b[0m\u001b[1mDFGFactor{CommonConvWrapper{\u001b[22m\u001b[34m\u001b[1mMixture\u001b[22m\u001b[39m\u001b[0m\u001b[1m...}}\u001b[22m\n", + " timestamp: 2022-03-23T07:09:55.020-05:00\n", + " nstime: 0 nanoseconds\n", + " label: \u001b[0m\u001b[1mx1x2f1\u001b[22m\n", + " solvable: 1\n", + " VariableOrder: [:x1, :x2]\n", + " multihypo: Float64[]\n", + " nullhypo: 0.0\n", + " tags: Set([:FACTOR])\n", + "\u001b[34m\u001b[1m FactorType: \u001b[22m\u001b[39mMixture{2, LinearRelative, (:hypo1, :hypo2), Tuple{Rayleigh{Float64}, Uniform{Float64}}}\n", + "\u001b[35mmechanics:\u001b[39m\n", + "LinearRelative{1, FullNormal}(FullNormal(\n", + "dim: 1\n", + "μ: [0.0]\n", + "Σ: [1.0]\n", + ")\n", + ")\n", + "\u001b[35mcomponents:\u001b[39m\n", + "(hypo1 = Rayleigh{Float64}(σ=3.0), hypo2 = Uniform{Float64}(a=30.0, b=55.0))\n", + "\u001b[35mdiversity:\u001b[39m\n", + "Categorical{Float64, Vector{Float64}}(support=Base.OneTo(2), p=[0.4, 0.6])\n", + "\u001b[35mdims:\u001b[39m\n", + "1\n", + "\u001b[35mlabels:\u001b[39m\n", + "[2]\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "addVariable!(fg, :x2, ContinuousScalar)\n", "mmo = Mixture(LinearRelative, \n", @@ -203,6 +358,27 @@ "addFactor!(fg, [:x1, :x2], mmo)" ] }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "┌ Info: {\"label\":\"x1x2f1\",\"_version\":\"0.18.1\",\"_variableOrderSymbols\":[\"x1\",\"x2\"],\"data\":{\"eliminated\":false,\"potentialused\":false,\"edgeIDs\":[],\"fnc\":{\"N\":2,\"F_\":\"PackedLinearRelative\",\"S\":[\"hypo1\",\"hypo2\"],\"components\":[{\"_type\":\"IncrementalInference.PackedRayleigh\",\"sigma\":3.0},{\"_type\":\"IncrementalInference.PackedUniform\",\"a\":30.0,\"b\":55.0,\"PackedSamplableTypeJSON\":\"IncrementalInference.PackedUniform\"}],\"diversity\":{\"_type\":\"IncrementalInference.PackedCategorical\",\"p\":[0.4,0.6]}},\"multihypo\":[],\"certainhypo\":[1,2],\"nullhypo\":0.0,\"solveInProgress\":0,\"inflation\":5.0},\"tags\":[\"FACTOR\"],\"timestamp\":\"2022-03-23T07:09:55.020-05:00\",\"nstime\":\"0\",\"fnctype\":\"Mixture\",\"solvable\":1}\n", + "└ @ Main /home/samc/Ganbatte/BinderNotebooks/julia/caesar-api/icra-2-nongaussian.ipynb:4\n" + ] + } + ], + "source": [ + "using DistributedFactorGraphs\n", + "pack = packFactor(fg, getFactor(fg, :x1x2f1))\n", + "using JSON\n", + "@info JSON.json(pack)" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -239,9 +415,40 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mtry doautoinit! of x2\n", + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39minit with useinitfct [:x1x2f1]\n", + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mdo init of x2\n", + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mtry doautoinit! of x3\n" + ] + }, + { + "data": { + "text/plain": [ + "\u001b[0m\u001b[1mDFGFactor{CommonConvWrapper{\u001b[22m\u001b[34m\u001b[1mLinearRelative\u001b[22m\u001b[39m\u001b[0m\u001b[1m...}}\u001b[22m\n", + " timestamp: 2022-03-23T07:10:50.911-05:00\n", + " nstime: 0 nanoseconds\n", + " label: \u001b[0m\u001b[1mx2x3f1\u001b[22m\n", + " solvable: 1\n", + " VariableOrder: [:x2, :x3]\n", + " multihypo: Float64[]\n", + " nullhypo: 0.0\n", + " tags: Set([:FACTOR])\n", + "\u001b[34m\u001b[1m FactorType: \u001b[22m\u001b[39mLinearRelative{1, Normal{Float64}}\n", + "\u001b[35mZ:\u001b[39m\n", + "Normal{Float64}(μ=-50.0, σ=1.0)\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "addVariable!(fg, :x3, ContinuousScalar)\n", "addFactor!(fg, [:x2, :x3], LinearRelative(Normal(-50, 1)))" @@ -281,9 +488,39 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mtry doautoinit! of x3\n", + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39minit with useinitfct [:x2x3f1, :x3x0f1]\n", + "\u001b[36m\u001b[1m[ \u001b[22m\u001b[39m\u001b[36m\u001b[1mInfo: \u001b[22m\u001b[39mdo init of x3\n" + ] + }, + { + "data": { + "text/plain": [ + "\u001b[0m\u001b[1mDFGFactor{CommonConvWrapper{\u001b[22m\u001b[34m\u001b[1mLinearRelative\u001b[22m\u001b[39m\u001b[0m\u001b[1m...}}\u001b[22m\n", + " timestamp: 2022-03-23T07:11:01.489-05:00\n", + " nstime: 0 nanoseconds\n", + " label: \u001b[0m\u001b[1mx3x0f1\u001b[22m\n", + " solvable: 1\n", + " VariableOrder: [:x3, :x0]\n", + " multihypo: Float64[]\n", + " nullhypo: 0.0\n", + " tags: Set([:FACTOR])\n", + "\u001b[34m\u001b[1m FactorType: \u001b[22m\u001b[39mLinearRelative{1, Normal{Float64}}\n", + "\u001b[35mZ:\u001b[39m\n", + "Normal{Float64}(μ=40.0, σ=1.0)\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "addFactor!(fg, [:x3, :x0], LinearRelative(Normal(40, 1)))" ] @@ -329,19 +566,61 @@ "In fact, many of the same underlying inference functions are involved with the automatic initialization process and the global multi-modal iSAM inference procedure.\n", "This concludes the ContinuousScalar tutorial" ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "┌ Info: Dict{String, Any}(\"label\" => \"x0\", \"dataEntry\" => \"{}\", \"nstime\" => \"0\", \"dataEntryType\" => \"{}\", \"ppeDict\" => \"{\\\"default\\\":{\\\"solveKey\\\":\\\"default\\\",\\\"suggested\\\":[0.002496014214205152],\\\"max\\\":[0.23310151135987967],\\\"mean\\\":[0.002496014214205152],\\\"lastUpdatedTimestamp\\\":\\\"2022-03-23T07:09:40.844\\\"}}\", \"solverDataDict\" => \"{\\\"default\\\":{\\\"vecval\\\":[1.5306267503501014,-0.2294976819052366,-0.313603214217259,0.4701066690583663,-0.10635476760697264,0.9354501620816313,1.1793238836401907,0.30382718575092615,0.7794806615864662,0.6433402141724786,1.8721294522158753,0.7899032446314936,-0.05404181757948353,1.4804144797831782,-0.10368283049764353,-0.7957685219413916,0.5656287227460458,-1.0092548336698153,-2.452379720431688,1.6299555436963542,-0.7770595397579406,-0.20412860301926436,1.0479848657023905,0.4225892701015142,-1.0052926768601078,-0.2676192557809827,1.2001794514483206,0.1288756892440473,0.6560221708749188,-0.2370100577665365,-1.7282323271736986,2.479952378793093,-1.3304777777009609,0.14113672927155424,0.7029136135132653,-1.843456448145046,0.6327474602596648,-0.5392677207434888,-0.5772152124682726,0.6083247627422769,-0.4918564956799333,1.363409947193714,-0.09982757951384795,1.8016860578367824,-0.7291131570075432,-0.6468224149155615,-0.13994608147257326,-2.6716380052770203,1.3524030499271433,0.11403602309228689,0.5270192705028969,-1.2717711811769281,0.6192612938202106,-1.7813128122100863,0.6186747124157098,-0.21644322546350364,0.996767128415561,-1.9517097811317585,0.9999038877273713,-1.9011052739570968,-2.811447888889859,1.255766296768914,-0.03372392435393326,-0.686751159607095,-0.7035055576888393,0.7274425487823006,-1.6520406861898524,-0.17982328923143193,-2.1923354894239417,0.6886345073396654,-0.1865764095875318,0.27327143570414386,1.3753473577349487,-0.7140528481758135,1.2866457994199079,-0.09039979536294607,-0.5149957249999139,-1.3680263997953181,0.21525405866933717,1.6551915161960156,0.26100521436230883,1.147778171271036,0.7408128209911212,0.10874951689839994,0.07266609536365393,-2.1222287508319617,-0.8790053143024814,0.5789643158843604,0.25728280253075353,0.6550235863575836,-0.10581934901070235,1.2203791600698923,1.0478295643642428,1.3874954896411145,-1.0639850000001407,-1.1245593605376651,-0.9055405264710135,-1.5707679376951798,1.3495745665564611,-0.2681137088542127],\\\"dimval\\\":1,\\\"vecbw\\\":[0.48117165315818466],\\\"dimbw\\\":1,\\\"BayesNetOutVertIDs\\\":[],\\\"dimIDs\\\":[0],\\\"dims\\\":1,\\\"eliminated\\\":false,\\\"BayesNetVertID\\\":\\\"_null\\\",\\\"separator\\\":[],\\\"variableType\\\":\\\"IncrementalInference.Position{1}\\\",\\\"initialized\\\":true,\\\"infoPerCoord\\\":[1.0],\\\"ismargin\\\":false,\\\"dontmargin\\\":false,\\\"solveInProgress\\\":0,\\\"solvedCount\\\":0,\\\"solveKey\\\":\\\"default\\\"},\\\"graphinit\\\":{\\\"vecval\\\":[1.5306267503501014,-0.2294976819052366,-0.313603214217259,0.4701066690583663,-0.10635476760697264,0.9354501620816313,1.1793238836401907,0.30382718575092615,0.7794806615864662,0.6433402141724786,1.8721294522158753,0.7899032446314936,-0.05404181757948353,1.4804144797831782,-0.10368283049764353,-0.7957685219413916,0.5656287227460458,-1.0092548336698153,-2.452379720431688,1.6299555436963542,-0.7770595397579406,-0.20412860301926436,1.0479848657023905,0.4225892701015142,-1.0052926768601078,-0.2676192557809827,1.2001794514483206,0.1288756892440473,0.6560221708749188,-0.2370100577665365,-1.7282323271736986,2.479952378793093,-1.3304777777009609,0.14113672927155424,0.7029136135132653,-1.843456448145046,0.6327474602596648,-0.5392677207434888,-0.5772152124682726,0.6083247627422769,-0.4918564956799333,1.363409947193714,-0.09982757951384795,1.8016860578367824,-0.7291131570075432,-0.6468224149155615,-0.13994608147257326,-2.6716380052770203,1.3524030499271433,0.11403602309228689,0.5270192705028969,-1.2717711811769281,0.6192612938202106,-1.7813128122100863,0.6186747124157098,-0.21644322546350364,0.996767128415561,-1.9517097811317585,0.9999038877273713,-1.9011052739570968,-2.811447888889859,1.255766296768914,-0.03372392435393326,-0.686751159607095,-0.7035055576888393,0.7274425487823006,-1.6520406861898524,-0.17982328923143193,-2.1923354894239417,0.6886345073396654,-0.1865764095875318,0.27327143570414386,1.3753473577349487,-0.7140528481758135,1.2866457994199079,-0.09039979536294607,-0.5149957249999139,-1.3680263997953181,0.21525405866933717,1.6551915161960156,0.26100521436230883,1.147778171271036,0.7408128209911212,0.10874951689839994,0.07266609536365393,-2.1222287508319617,-0.8790053143024814,0.5789643158843604,0.25728280253075353,0.6550235863575836,-0.10581934901070235,1.2203791600698923,1.0478295643642428,1.3874954896411145,-1.0639850000001407,-1.1245593605376651,-0.9055405264710135,-1.5707679376951798,1.3495745665564611,-0.2681137088542127],\\\"dimval\\\":1,\\\"vecbw\\\":[0.48117165315818466],\\\"dimbw\\\":1,\\\"BayesNetOutVertIDs\\\":[],\\\"dimIDs\\\":[0],\\\"dims\\\":1,\\\"eliminated\\\":false,\\\"BayesNetVertID\\\":\\\"_null\\\",\\\"separator\\\":[],\\\"variableType\\\":\\\"IncrementalInference.Position{1}\\\",\\\"initialized\\\":true,\\\"infoPerCoord\\\":[1.0],\\\"ismargin\\\":false,\\\"dontmargin\\\":false,\\\"solveInProgress\\\":0,\\\"solvedCount\\\":0,\\\"solveKey\\\":\\\"graphinit\\\"}}\", \"smallData\" => \"{}\", \"variableType\" => \"IncrementalInference.Position{1}\", \"solvable\" => 1, \"tags\" => \"[\\\"VARIABLE\\\"]\", \"timestamp\" => \"2022-03-23T07:08:48.944-05:00\", \"_version\" => \"0.18.1\")\n", + "└ @ Main /home/samc/Ganbatte/BinderNotebooks/julia/caesar-api/icra-2-nongaussian.ipynb:4\n", + "┌ Info: Dict{String, Any}(\"label\" => \"x2\", \"dataEntry\" => \"{}\", \"nstime\" => \"0\", \"dataEntryType\" => \"{}\", \"ppeDict\" => \"{\\\"default\\\":{\\\"solveKey\\\":\\\"default\\\",\\\"suggested\\\":[35.0402182720299],\\\"max\\\":[12.994065277758],\\\"mean\\\":[35.0402182720299],\\\"lastUpdatedTimestamp\\\":\\\"2022-03-23T07:10:53.669\\\"}}\", \"solverDataDict\" => \"{\\\"default\\\":{\\\"vecval\\\":[11.056545421498658,61.92943267540131,42.91433903635758,52.940085401593564,59.78456165911749,46.521753197876784,44.425966803574184,45.047883378450216,12.728908445791767,59.758229338240824,45.24114874108556,40.883905195044186,44.08266416330211,16.444538725335562,13.627442675865453,54.908081658930115,14.930984218483971,13.055265364691312,13.744362041505305,48.86080777629039,15.35583346409873,13.27754529694894,47.681448534852,56.89844857275312,42.45382397986709,47.68742169569748,13.28963181906435,53.799107985225035,61.469583799619876,13.680795520982779,11.630286091982741,59.57028329905018,45.72140055255323,57.353234198868996,56.431015533987214,11.360669563277536,15.53214819325162,56.290053363886535,10.466782878633696,47.0764740578176,11.615766586196603,12.553589512626324,16.270858625210884,44.513265173711275,57.681672536746376,37.768355229481685,63.850257129444,39.6716712989824,59.99859069828146,13.578791765324837,12.049134883371478,44.84699587953056,42.13647114997942,10.436280541285111,45.99386705223309,41.43165157510616,49.51863604619013,43.18035225877525,15.526321423725166,7.200654121343755,58.63011300645791,62.94552826246385,11.146754707432166,45.79343316104526,50.38656247830743,58.77994432065988,12.291920677596586,12.62489903701545,8.267954457500744,12.976823738731984,14.229390574882121,49.45799212748993,13.820685926528459,10.136589719788844,40.99895487620523,45.675528230922616,43.75541298397538,38.27540846261486,51.202968267311206,13.711746819658789,63.67545188197844,60.56561571436663,50.93652378786665,14.335617709543358,52.063294352554344,12.028609573380795,61.5297131081227,12.413548108931517,10.178149228181297,14.773627966282307,12.497968891966952,45.27499328663154,65.72292925466533,14.445630348649313,9.93169744345856,45.36921530418833,13.686173932659134,63.00910002802882,64.67142190000004,12.067855736542633],\\\"dimval\\\":1,\\\"vecbw\\\":[1.622638739505191],\\\"dimbw\\\":1,\\\"BayesNetOutVertIDs\\\":[],\\\"dimIDs\\\":[0],\\\"dims\\\":1,\\\"eliminated\\\":false,\\\"BayesNetVertID\\\":\\\"_null\\\",\\\"separator\\\":[],\\\"variableType\\\":\\\"IncrementalInference.Position{1}\\\",\\\"initialized\\\":true,\\\"infoPerCoord\\\":[1.0],\\\"ismargin\\\":false,\\\"dontmargin\\\":false,\\\"solveInProgress\\\":0,\\\"solvedCount\\\":0,\\\"solveKey\\\":\\\"default\\\"},\\\"graphinit\\\":{\\\"vecval\\\":[11.056545421498658,61.92943267540131,42.91433903635758,52.940085401593564,59.78456165911749,46.521753197876784,44.425966803574184,45.047883378450216,12.728908445791767,59.758229338240824,45.24114874108556,40.883905195044186,44.08266416330211,16.444538725335562,13.627442675865453,54.908081658930115,14.930984218483971,13.055265364691312,13.744362041505305,48.86080777629039,15.35583346409873,13.27754529694894,47.681448534852,56.89844857275312,42.45382397986709,47.68742169569748,13.28963181906435,53.799107985225035,61.469583799619876,13.680795520982779,11.630286091982741,59.57028329905018,45.72140055255323,57.353234198868996,56.431015533987214,11.360669563277536,15.53214819325162,56.290053363886535,10.466782878633696,47.0764740578176,11.615766586196603,12.553589512626324,16.270858625210884,44.513265173711275,57.681672536746376,37.768355229481685,63.850257129444,39.6716712989824,59.99859069828146,13.578791765324837,12.049134883371478,44.84699587953056,42.13647114997942,10.436280541285111,45.99386705223309,41.43165157510616,49.51863604619013,43.18035225877525,15.526321423725166,7.200654121343755,58.63011300645791,62.94552826246385,11.146754707432166,45.79343316104526,50.38656247830743,58.77994432065988,12.291920677596586,12.62489903701545,8.267954457500744,12.976823738731984,14.229390574882121,49.45799212748993,13.820685926528459,10.136589719788844,40.99895487620523,45.675528230922616,43.75541298397538,38.27540846261486,51.202968267311206,13.711746819658789,63.67545188197844,60.56561571436663,50.93652378786665,14.335617709543358,52.063294352554344,12.028609573380795,61.5297131081227,12.413548108931517,10.178149228181297,14.773627966282307,12.497968891966952,45.27499328663154,65.72292925466533,14.445630348649313,9.93169744345856,45.36921530418833,13.686173932659134,63.00910002802882,64.67142190000004,12.067855736542633],\\\"dimval\\\":1,\\\"vecbw\\\":[1.622638739505191],\\\"dimbw\\\":1,\\\"BayesNetOutVertIDs\\\":[],\\\"dimIDs\\\":[0],\\\"dims\\\":1,\\\"eliminated\\\":false,\\\"BayesNetVertID\\\":\\\"_null\\\",\\\"separator\\\":[],\\\"variableType\\\":\\\"IncrementalInference.Position{1}\\\",\\\"initialized\\\":true,\\\"infoPerCoord\\\":[1.0],\\\"ismargin\\\":false,\\\"dontmargin\\\":false,\\\"solveInProgress\\\":0,\\\"solvedCount\\\":0,\\\"solveKey\\\":\\\"graphinit\\\"}}\", \"smallData\" => \"{}\", \"variableType\" => \"IncrementalInference.Position{1}\", \"solvable\" => 1, \"tags\" => \"[\\\"VARIABLE\\\"]\", \"timestamp\" => \"2022-03-23T07:09:53.402-05:00\", \"_version\" => \"0.18.1\")\n", + "└ @ Main /home/samc/Ganbatte/BinderNotebooks/julia/caesar-api/icra-2-nongaussian.ipynb:4\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "┌ Info: Dict{String, Any}(\"label\" => \"x3\", \"dataEntry\" => \"{}\", \"nstime\" => \"0\", \"dataEntryType\" => \"{}\", \"ppeDict\" => \"{\\\"default\\\":{\\\"solveKey\\\":\\\"default\\\",\\\"suggested\\\":[-39.50502665934523],\\\"max\\\":[-39.58882115187409],\\\"mean\\\":[-39.50502665934523],\\\"lastUpdatedTimestamp\\\":\\\"2022-03-23T07:11:07.482\\\"}}\", \"solverDataDict\" => \"{\\\"default\\\":{\\\"vecval\\\":[-39.53963537863787,-40.74636407621055,-39.59750104980447,-41.67294924175446,-39.081137162035056,-37.69868686863006,-39.23913599632294,-38.438570405255604,-41.58005404868901,-37.55591492039292,-40.059671266335314,-38.49546414945179,-39.98166437817355,-40.45630373219981,-38.7728549725746,-40.35354195153519,-39.50702939447998,-40.006681774365006,-36.8523733590635,-35.282045122187185,-38.18568815212143,-38.75406111443712,-39.106612651065475,-40.527107671090285,-40.25203075221147,-39.03144424049256,-41.265141391514824,-41.15175610418193,-39.14816035585719,-41.09483841039708,-37.4600689879028,-36.23738897730057,-41.61796561322531,-40.12390646458494,-42.000130430097556,-39.523010215244774,-40.21495412504567,-37.260749273493055,-39.74085061445902,-38.32328144536802,-38.174029759956056,-39.09825840850132,-40.00359235533428,-37.267367340120444,-41.06806318177174,-38.145248761293665,-42.00346177397072,-39.27464025419245,-42.19604754827043,-39.45566163623053,-39.77671235947652,-41.827743353891485,-39.50738215786457,-39.74356793550043,-39.797883546613434,-37.90552950836857,-39.38296555750958,-41.70977326270174,-37.44948187687166,-40.49514739274362,-38.65682621725868,-40.81580152740579,-37.158549037832636,-38.15116378368864,-40.1145753923775,-40.28235976450158,-40.283331645216364,-37.910044699060656,-39.16733142419621,-40.5289959533134,-42.613511588463446,-38.23655598962229,-38.83682383852599,-38.89279703075885,-38.26453035782872,-40.11522868342049,-36.42561453495342,-40.25984083039331,-42.12521332949706,-37.78335255142332,-38.25026909835138,-40.20853646233936,-41.403072898184,-38.48152471586085,-40.41512333611078,-41.95464019581946,-37.9254395271324,-41.23849166966603,-39.18375541537794,-38.72344571520736,-39.2645041341982,-38.156797199014264,-38.58434835619968,-39.41469192150689,-39.2319065595825,-40.516127233900036,-40.528492566647216,-39.963524124147234,-38.50447582809898,-41.7117665880664],\\\"dimval\\\":1,\\\"vecbw\\\":[0.6660203593292329],\\\"dimbw\\\":1,\\\"BayesNetOutVertIDs\\\":[],\\\"dimIDs\\\":[0],\\\"dims\\\":1,\\\"eliminated\\\":false,\\\"BayesNetVertID\\\":\\\"_null\\\",\\\"separator\\\":[],\\\"variableType\\\":\\\"IncrementalInference.Position{1}\\\",\\\"initialized\\\":true,\\\"infoPerCoord\\\":[2.0],\\\"ismargin\\\":false,\\\"dontmargin\\\":false,\\\"solveInProgress\\\":0,\\\"solvedCount\\\":0,\\\"solveKey\\\":\\\"default\\\"},\\\"graphinit\\\":{\\\"vecval\\\":[-39.53963537863787,-40.74636407621055,-39.59750104980447,-41.67294924175446,-39.081137162035056,-37.69868686863006,-39.23913599632294,-38.438570405255604,-41.58005404868901,-37.55591492039292,-40.059671266335314,-38.49546414945179,-39.98166437817355,-40.45630373219981,-38.7728549725746,-40.35354195153519,-39.50702939447998,-40.006681774365006,-36.8523733590635,-35.282045122187185,-38.18568815212143,-38.75406111443712,-39.106612651065475,-40.527107671090285,-40.25203075221147,-39.03144424049256,-41.265141391514824,-41.15175610418193,-39.14816035585719,-41.09483841039708,-37.4600689879028,-36.23738897730057,-41.61796561322531,-40.12390646458494,-42.000130430097556,-39.523010215244774,-40.21495412504567,-37.260749273493055,-39.74085061445902,-38.32328144536802,-38.174029759956056,-39.09825840850132,-40.00359235533428,-37.267367340120444,-41.06806318177174,-38.145248761293665,-42.00346177397072,-39.27464025419245,-42.19604754827043,-39.45566163623053,-39.77671235947652,-41.827743353891485,-39.50738215786457,-39.74356793550043,-39.797883546613434,-37.90552950836857,-39.38296555750958,-41.70977326270174,-37.44948187687166,-40.49514739274362,-38.65682621725868,-40.81580152740579,-37.158549037832636,-38.15116378368864,-40.1145753923775,-40.28235976450158,-40.283331645216364,-37.910044699060656,-39.16733142419621,-40.5289959533134,-42.613511588463446,-38.23655598962229,-38.83682383852599,-38.89279703075885,-38.26453035782872,-40.11522868342049,-36.42561453495342,-40.25984083039331,-42.12521332949706,-37.78335255142332,-38.25026909835138,-40.20853646233936,-41.403072898184,-38.48152471586085,-40.41512333611078,-41.95464019581946,-37.9254395271324,-41.23849166966603,-39.18375541537794,-38.72344571520736,-39.2645041341982,-38.156797199014264,-38.58434835619968,-39.41469192150689,-39.2319065595825,-40.516127233900036,-40.528492566647216,-39.963524124147234,-38.50447582809898,-41.7117665880664],\\\"dimval\\\":1,\\\"vecbw\\\":[0.6660203593292329],\\\"dimbw\\\":1,\\\"BayesNetOutVertIDs\\\":[],\\\"dimIDs\\\":[0],\\\"dims\\\":1,\\\"eliminated\\\":false,\\\"BayesNetVertID\\\":\\\"_null\\\",\\\"separator\\\":[],\\\"variableType\\\":\\\"IncrementalInference.Position{1}\\\",\\\"initialized\\\":true,\\\"infoPerCoord\\\":[2.0],\\\"ismargin\\\":false,\\\"dontmargin\\\":false,\\\"solveInProgress\\\":0,\\\"solvedCount\\\":0,\\\"solveKey\\\":\\\"graphinit\\\"}}\", \"smallData\" => \"{}\", \"variableType\" => \"IncrementalInference.Position{1}\", \"solvable\" => 1, \"tags\" => \"[\\\"VARIABLE\\\"]\", \"timestamp\" => \"2022-03-23T07:10:50.911-05:00\", \"_version\" => \"0.18.1\")\n", + "└ @ Main /home/samc/Ganbatte/BinderNotebooks/julia/caesar-api/icra-2-nongaussian.ipynb:4\n", + "┌ Info: Dict{String, Any}(\"label\" => \"x1\", \"dataEntry\" => \"{}\", \"nstime\" => \"0\", \"dataEntryType\" => \"{}\", \"ppeDict\" => \"{\\\"default\\\":{\\\"solveKey\\\":\\\"default\\\",\\\"suggested\\\":[9.710841172753272],\\\"max\\\":[10.19979287963164],\\\"mean\\\":[9.710841172753272],\\\"lastUpdatedTimestamp\\\":\\\"2022-03-23T07:10:16.526\\\"}}\", \"solverDataDict\" => \"{\\\"default\\\":{\\\"vecval\\\":[8.482546849306935,9.618612680000782,9.046171562553836,9.649410910369458,11.551615066261872,10.312700467716148,10.444958769911905,10.308302228991037,11.850283599167085,10.533600630295316,10.883353984553219,10.014974613368338,10.466803623886973,11.958940568660957,9.708118639993321,10.817928145551916,9.34000994163546,9.39862597787487,6.4785300694392545,10.062709946549132,9.846951387933137,8.759489085342707,10.946986764508512,8.70968363170802,7.111690502459284,7.783017504575523,10.823033340954748,10.109948537625801,10.268667800531603,9.266498554668454,7.841244322162456,10.697742713901306,8.846875070413315,10.183547752803467,11.817349529286748,7.2640048932624435,10.54046899029977,11.482464772810058,9.062081046384854,11.289313961989576,9.593791562163899,9.651516162178062,9.935463188826423,11.01742022475204,9.396899991462387,7.2838807859777175,10.175934230008382,6.52545308835667,9.571277936201437,9.977945343527757,9.634976327969966,7.520380989178486,11.816000398798039,10.08200593743475,11.90196732000081,8.113533028622308,11.057642993966873,6.205417678037469,11.15819104391944,5.453399090837219,7.6093497797677445,11.196160972899387,9.29600032852771,10.410522001197315,8.194267738146104,10.437531403895965,9.111364861004454,9.797567027027284,7.6346093832491215,8.99521729310717,11.314175434238308,10.650548576474767,12.073365021298631,9.076932761092117,10.679946450133144,10.985247557454363,10.422184886450564,7.3447467000208,9.538759183644055,10.531036365876684,11.538864969817084,11.577119562373415,11.191542078605323,10.492783665969068,10.106040976313556,8.904367044005891,10.015091102670354,10.23412753398181,6.942251511850194,11.143550463997538,8.933365987588356,10.7380910727429,12.455121581349376,9.184079064064443,6.541197073610756,8.078469011221852,8.963699520463882,8.472254253637667,11.569558318056629,9.050652995571973],\\\"dimval\\\":1,\\\"vecbw\\\":[0.5895484804470402],\\\"dimbw\\\":1,\\\"BayesNetOutVertIDs\\\":[],\\\"dimIDs\\\":[0],\\\"dims\\\":1,\\\"eliminated\\\":false,\\\"BayesNetVertID\\\":\\\"_null\\\",\\\"separator\\\":[],\\\"variableType\\\":\\\"IncrementalInference.Position{1}\\\",\\\"initialized\\\":true,\\\"infoPerCoord\\\":[1.0],\\\"ismargin\\\":false,\\\"dontmargin\\\":false,\\\"solveInProgress\\\":0,\\\"solvedCount\\\":0,\\\"solveKey\\\":\\\"default\\\"},\\\"graphinit\\\":{\\\"vecval\\\":[8.482546849306935,9.618612680000782,9.046171562553836,9.649410910369458,11.551615066261872,10.312700467716148,10.444958769911905,10.308302228991037,11.850283599167085,10.533600630295316,10.883353984553219,10.014974613368338,10.466803623886973,11.958940568660957,9.708118639993321,10.817928145551916,9.34000994163546,9.39862597787487,6.4785300694392545,10.062709946549132,9.846951387933137,8.759489085342707,10.946986764508512,8.70968363170802,7.111690502459284,7.783017504575523,10.823033340954748,10.109948537625801,10.268667800531603,9.266498554668454,7.841244322162456,10.697742713901306,8.846875070413315,10.183547752803467,11.817349529286748,7.2640048932624435,10.54046899029977,11.482464772810058,9.062081046384854,11.289313961989576,9.593791562163899,9.651516162178062,9.935463188826423,11.01742022475204,9.396899991462387,7.2838807859777175,10.175934230008382,6.52545308835667,9.571277936201437,9.977945343527757,9.634976327969966,7.520380989178486,11.816000398798039,10.08200593743475,11.90196732000081,8.113533028622308,11.057642993966873,6.205417678037469,11.15819104391944,5.453399090837219,7.6093497797677445,11.196160972899387,9.29600032852771,10.410522001197315,8.194267738146104,10.437531403895965,9.111364861004454,9.797567027027284,7.6346093832491215,8.99521729310717,11.314175434238308,10.650548576474767,12.073365021298631,9.076932761092117,10.679946450133144,10.985247557454363,10.422184886450564,7.3447467000208,9.538759183644055,10.531036365876684,11.538864969817084,11.577119562373415,11.191542078605323,10.492783665969068,10.106040976313556,8.904367044005891,10.015091102670354,10.23412753398181,6.942251511850194,11.143550463997538,8.933365987588356,10.7380910727429,12.455121581349376,9.184079064064443,6.541197073610756,8.078469011221852,8.963699520463882,8.472254253637667,11.569558318056629,9.050652995571973],\\\"dimval\\\":1,\\\"vecbw\\\":[0.5895484804470402],\\\"dimbw\\\":1,\\\"BayesNetOutVertIDs\\\":[],\\\"dimIDs\\\":[0],\\\"dims\\\":1,\\\"eliminated\\\":false,\\\"BayesNetVertID\\\":\\\"_null\\\",\\\"separator\\\":[],\\\"variableType\\\":\\\"IncrementalInference.Position{1}\\\",\\\"initialized\\\":true,\\\"infoPerCoord\\\":[1.0],\\\"ismargin\\\":false,\\\"dontmargin\\\":false,\\\"solveInProgress\\\":0,\\\"solvedCount\\\":0,\\\"solveKey\\\":\\\"graphinit\\\"}}\", \"smallData\" => \"{}\", \"variableType\" => \"IncrementalInference.Position{1}\", \"solvable\" => 1, \"tags\" => \"[\\\"VARIABLE\\\"]\", \"timestamp\" => \"2022-03-23T07:09:29.268-05:00\", \"_version\" => \"0.18.1\")\n", + "└ @ Main /home/samc/Ganbatte/BinderNotebooks/julia/caesar-api/icra-2-nongaussian.ipynb:4\n" + ] + } + ], + "source": [ + "using DistributedFactorGraphs\n", + "vs = ls(fg)\n", + "for v in vs\n", + " @info packVariable(fg, getVariable(fg, v))\n", + "end\n", + "#fs = lsf(fg)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Julia 1.7.2", + "display_name": "Julia 1.6.3", "language": "julia", - "name": "julia-1.7" + "name": "julia-1.6" }, "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", - "version": "1.7.2" + "version": "1.6.3" }, "orig_nbformat": 4 },