Skip to content

Commit c5059b4

Browse files
authored
Merge branch 'master' into 23Q2/test/restore3alttests
2 parents 4a73be2 + 4918b57 commit c5059b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1250
-371
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- master
7-
- develop
87
- release**
98
workflow_dispatch:
109
jobs:
@@ -55,7 +54,7 @@ jobs:
5554
arch:
5655
- x64
5756
version:
58-
- '1.9'
57+
- '~1.10.0-0'
5958
group:
6059
- 'basic_functional_group'
6160
steps:
@@ -97,7 +96,7 @@ jobs:
9796
arch:
9897
- x64
9998
version:
100-
- '1.9'
99+
- '~1.10.0-0'
101100
group:
102101
- 'test_cases_group'
103102
steps:

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ Alternatively, either use the Github Blame, or the Github `/compare/v0.18.0...v0
1111

1212
The list below highlights breaking changes according to normal semver workflow -- i.e. breaking changes go through at least one deprecatation (via warnings) on the dominant number in the version number. E.g. v0.18 -> v0.19 (warnings) -> v0.20 (breaking). Note that ongoing efforts are made to properly deprecate old code/APIs
1313

14+
# Changes in v0.34
15+
16+
- Start transition to Manopt.jl via Riemannian Levenberg Marquart.
17+
- Deprecate `AbstractRelativeRoots`.
18+
19+
# Changes in v0.33
20+
21+
- Upgrades for DFG using StructTypes.jl (serialization).
1422
# Changes in v0.32
1523

1624
- Major internal refactoring of `CommonConvWrapper` to avoid abstract field types, and better standardization; towards cleanup of internal multihypo handling and naming conventions.

Project.toml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ version = "0.34.0"
88
ApproxManifoldProducts = "9bbbb610-88a1-53cd-9763-118ce10c1f89"
99
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
1010
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
11+
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
1112
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
1213
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
1314
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
@@ -17,6 +18,7 @@ DistributedFactorGraphs = "b5cc3c7e-6572-11e9-2517-99fb8daf2f04"
1718
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
1819
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1920
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
21+
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
2022
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
2123
FunctionalStateMachine = "3e9e306e-7e3c-11e9-12d2-8f8f67a2f951"
2224
JSON3 = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
@@ -26,9 +28,8 @@ Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
2628
ManifoldDiff = "af67fdf4-a580-4b9f-bbec-742ef357defd"
2729
Manifolds = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e"
2830
ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
31+
Manopt = "0fc0a36d-df90-57f3-8f93-d78a9fc72bb5"
2932
MetaGraphs = "626554b9-1ddb-594c-aa3c-2596fe9399a5"
30-
NLSolversBase = "d41bc354-129a-5804-8e4c-c37616107c6c"
31-
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
3233
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
3334
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
3435
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
@@ -38,6 +39,7 @@ RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
3839
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
3940
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
4041
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
42+
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
4143
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
4244
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
4345
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
@@ -47,32 +49,47 @@ TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b"
4749
TimeZones = "f269a46b-ccf7-5d73-abea-4c690281aa53"
4850
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
4951

52+
[weakdeps]
53+
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
54+
Gadfly = "c91e804a-d5a3-530f-b6f0-dfbca275c004"
55+
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
56+
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
57+
58+
[extensions]
59+
DiffEqFactorExt = "DifferentialEquations"
60+
GadflyExt = "Gadfly"
61+
InteractiveUtilsExt = "InteractiveUtils"
62+
InterpolationsExt = "Interpolations"
63+
5064
[compat]
5165
ApproxManifoldProducts = "0.7"
5266
BSON = "0.2, 0.3"
67+
BlockArrays = "0.16"
5368
Combinatorics = "1.0"
5469
DataStructures = "0.16, 0.17, 0.18"
55-
DistributedFactorGraphs = "0.21"
70+
DelimitedFiles = "1"
71+
DistributedFactorGraphs = "0.21, 0.22"
5672
Distributions = "0.24, 0.25"
5773
DocStringExtensions = "0.8, 0.9"
5874
FileIO = "1"
75+
FiniteDiff = "2"
5976
FiniteDifferences = "0.12"
6077
FunctionalStateMachine = "0.2.9"
6178
JSON3 = "1"
6279
KernelDensityEstimate = "0.5.6"
6380
ManifoldDiff = "0.3"
6481
Manifolds = "0.8.15"
6582
ManifoldsBase = "0.13.12, 0.14"
83+
Manopt = "0.4.27"
6684
MetaGraphs = "0.7"
67-
NLSolversBase = "7.6"
68-
NLsolve = "3, 4"
6985
Optim = "1"
7086
OrderedCollections = "1"
7187
PrecompileTools = "1"
7288
ProgressMeter = "1"
7389
RecursiveArrayTools = "2.31.1"
7490
Reexport = "1"
7591
Requires = "1"
92+
SparseDiffTools = "2"
7693
StaticArrays = "1"
7794
StatsBase = "0.32, 0.33, 0.34"
7895
StructTypes = "1"
@@ -81,15 +98,14 @@ TimeZones = "1.3.1"
8198
julia = "1.8"
8299

83100
[extras]
84-
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
85101
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
86102
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
87-
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
88-
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
103+
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
89104
Manopt = "0fc0a36d-df90-57f3-8f93-d78a9fc72bb5"
90105
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
91106
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
92107
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
108+
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
93109

94110
[targets]
95-
test = ["DifferentialEquations", "Flux", "Graphs", "Manopt", "InteractiveUtils", "Interpolations", "Pkg", "Rotations", "Test"]
111+
test = ["DifferentialEquations", "Flux", "Graphs", "Manopt", "InteractiveUtils", "Interpolations", "LineSearches", "Pkg", "Rotations", "Test", "Zygote"]

src/ODE/DERelative.jl renamed to ext/DiffEqFactorExt.jl

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,20 @@
1+
module DiffEqFactorExt
12

2-
@info "IncrementalInference.jl is loading tools related to DifferentialEquations.jl"
3+
@info "IncrementalInference.jl is loading extensions related to DifferentialEquations.jl"
34

4-
using .DifferentialEquations
5+
using DifferentialEquations
6+
import DifferentialEquations: solve
57

6-
import .DifferentialEquations: solve
8+
using Dates
79

8-
import IncrementalInference: getSample, getManifold
10+
using IncrementalInference
11+
import IncrementalInference: getSample, getManifold, DERelative
912

10-
export DERelative
13+
using DocStringExtensions
1114

12-
"""
13-
$TYPEDEF
15+
export DERelative
1416

15-
Build a full ODE solution into a relative factor to condense possible sensor data into a relative transformation,
16-
but keeping the parameter estimation process fluid. Assumes first and second variable in order
17-
are of same dimension and compatible manifolds, such that ODE runs from Xi to Xi+1 on all
18-
dimensions. Internal state vector can be decoupled onto different domain as needed.
1917

20-
Notes
21-
- Based on DifferentialEquations.jl
22-
- `getSample` step does the `solve(ODEProblem)` step.
23-
- `tspan` is taken from variables only once at object construction -- i.e. won't detect changed timestamps.
24-
- Regular factor evaluation is done as full dimension `AbstractRelativeRoots`, and is basic linear difference.
25-
26-
DevNotes
27-
- FIXME see 1025, `multihypo=` will not yet work.
28-
- FIXME Lots of consolidation and standardization to do, see RoME.jl #244 regarding Manifolds.jl.
29-
- TODO does not yet handle case where a factor spans across two timezones.
30-
"""
31-
struct DERelative{T <: InferenceVariable, P, D} <: AbstractRelativeRoots
32-
domain::Type{T}
33-
forwardProblem::P
34-
backwardProblem::P
35-
# second element of this data tuple is additional variables that will be passed down as a parameter
36-
data::D
37-
specialSampler::Function
38-
end
3918

4019
getManifold(de::DERelative{T}) where {T} = getManifold(de.domain)
4120

@@ -132,6 +111,8 @@ function _solveFactorODE!(measArr, prob, u0pts, Xtra...)
132111
return sol
133112
end
134113

114+
getSample(cf::CalcFactor{<:DERelative}) = error("getSample(::CalcFactor{<:DERelative}) not implemented yet")
115+
135116
# FIXME see #1025, `multihypo=` will not work properly yet
136117
function sampleFactor(cf::CalcFactor{<:DERelative}, N::Int = 1)
137118
#
@@ -220,3 +201,5 @@ end
220201
# ode.problem.f.f
221202

222203
#
204+
205+
end # module

src/EmbeddedPlottingUtils.jl renamed to ext/GadflyExt.jl

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
module GadflyExt
12

2-
@info "Defining spyCliqMat(..) for visualizing association matrix of a clique in the Bayes (Junction) tree"
3+
@info "IncrementalInference.jl is loading plotting extensions relating to Gadfly.jl"
34

4-
exportimg(pl) = Gadfly.PNG(pl)
5+
using Gadfly
6+
using DocStringExtensions
7+
using IncrementalInference: AbstractBayesTree, TreeClique, getCliqueData, getCliqAssocMat, getCliqMat, getLabel, getCliqMsgMat, getClique
8+
import IncrementalInference: exportimg, spyCliqMat
9+
10+
export exportimg, spyCliqMat
511

6-
export spyCliqMat
12+
exportimg(pl) = Gadfly.PNG(pl)
713

814
"""
915
$SIGNATURES
@@ -59,3 +65,6 @@ function spyCliqMat(
5965
)
6066
return spyCliqMat(getClique(bt, lbl); showmsg = showmsg, suppressprint = suppressprint)
6167
end
68+
69+
70+
end

src/services/HeatmapSampler.jl renamed to ext/HeatmapSampler.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
# heatmap sampler (experimental)
22

3-
@info "IncrementalInference.jl is loading tools related to Interpolations.jl."
4-
5-
using .Interpolations
6-
7-
# only export on Requires.jl
8-
export HeatmapGridDensity, PackedHeatmapGridDensity
9-
export LevelSetGridNormal, PackedLevelSetGridNormal
10-
11-
export sampleHeatmap
12-
133
##
144

155
getManifold(hgd::HeatmapGridDensity) = getManifold(hgd.densityFnc)

src/RequireInteractiveUtils.jl renamed to ext/InteractiveUtilsExt.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
module InteractiveUtilsExt
12

2-
@info "IncrementalInference.jl is loading tools related to InteractiveUtils.jl."
3+
@info "IncrementalInference.jl is loading extension related to InteractiveUtils.jl."
34

4-
# this requires InteractiveUtils
5+
using InteractiveUtils
6+
using DocStringExtensions
7+
using IncrementalInference: InferenceVariable, AbstractPrior, AbstractRelativeMinimize, AbstractManifoldMinimize
8+
# using IncrementalInference: getCurrentWorkspaceFactors, getCurrentWorkspaceVariables, listTypeTree
9+
import IncrementalInference: getCurrentWorkspaceFactors, getCurrentWorkspaceVariables, listTypeTree
510

611
export getCurrentWorkspaceFactors, getCurrentWorkspaceVariables
712
export listTypeTree
@@ -14,7 +19,7 @@ Return all factors currently registered in the workspace.
1419
function getCurrentWorkspaceFactors()
1520
return [
1621
InteractiveUtils.subtypes(AbstractPrior)...,
17-
InteractiveUtils.subtypes(AbstractRelativeRoots)...,
22+
# InteractiveUtils.subtypes(AbstractRelativeRoots)...,
1823
InteractiveUtils.subtypes(AbstractRelativeMinimize)...,
1924
]
2025
end
@@ -25,7 +30,7 @@ end
2530
Return all variables currently registered in the workspace.
2631
"""
2732
function getCurrentWorkspaceVariables()
28-
return InteractiveUtils.subtypes(IIF.InferenceVariable)
33+
return InteractiveUtils.subtypes(InferenceVariable)
2934
end
3035

3136
function _listTypeTree(mytype, printlevel::Int)
@@ -50,3 +55,5 @@ function listTypeTree(T)
5055
println(T)
5156
return _listTypeTree(T, 0)
5257
end
58+
59+
end #module

ext/InterpolationsExt.jl

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module InterpolationsExt
2+
3+
@info "IncrementalInference.jl is loading extensions related to Interpolations.jl."
4+
5+
using Interpolations
6+
using Statistics
7+
using DocStringExtensions
8+
using TensorCast
9+
using Manifolds
10+
using ApproxManifoldProducts
11+
import ApproxManifoldProducts: sample
12+
const AMP = ApproxManifoldProducts
13+
14+
import IncrementalInference: getManifold
15+
import IncrementalInference: HeatmapGridDensity, PackedHeatmapGridDensity
16+
import IncrementalInference: LevelSetGridNormal, PackedLevelSetGridNormal
17+
18+
export HeatmapGridDensity, PackedHeatmapGridDensity
19+
export LevelSetGridNormal, PackedLevelSetGridNormal
20+
export sampleHeatmap
21+
22+
23+
include("HeatmapSampler.jl")
24+
25+
end # module

ext/WeakDepsPrototypes.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
"""
3+
$TYPEDEF
4+
5+
Build a full ODE solution into a relative factor to condense possible sensor data into a relative transformation,
6+
but keeping the parameter estimation process fluid. Assumes first and second variable in order
7+
are of same dimension and compatible manifolds, such that ODE runs from Xi to Xi+1 on all
8+
dimensions. Internal state vector can be decoupled onto different domain as needed.
9+
10+
Notes
11+
- Based on DifferentialEquations.jl
12+
- `getSample` step does the `solve(ODEProblem)` step.
13+
- `tspan` is taken from variables only once at object construction -- i.e. won't detect changed timestamps.
14+
- Regular factor evaluation is done as full dimension `AbstractRelativeRoots`, and is basic linear difference.
15+
16+
DevNotes
17+
- FIXME see 1025, `multihypo=` will not yet work.
18+
- FIXME Lots of consolidation and standardization to do, see RoME.jl #244 regarding Manifolds.jl.
19+
- TODO does not yet handle case where a factor spans across two timezones.
20+
"""
21+
struct DERelative{T <: InferenceVariable, P, D} <: AbstractRelativeMinimize
22+
domain::Type{T}
23+
forwardProblem::P
24+
backwardProblem::P
25+
# second element of this data tuple is additional variables that will be passed down as a parameter
26+
data::D
27+
specialSampler::Function
28+
end
29+
30+
# InteractiveUtils.jl
31+
function getCurrentWorkspaceFactors end
32+
function getCurrentWorkspaceVariables end
33+
function listTypeTree end
34+
35+
# Gadfly.jl
36+
function exportimg end
37+
function spyCliqMat end

0 commit comments

Comments
 (0)