Skip to content

Commit e3ee67b

Browse files
authored
Merge pull request #1846 from JuliaRobotics/master
release v0.35.5-rc1
2 parents 1147e7e + 7670dd6 commit e3ee67b

16 files changed

+162
-79
lines changed

.github/workflows/TagBot.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
name: TagBot
2-
32
on:
4-
issues:
5-
types: [closed,]
6-
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: 3
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
723
jobs:
824
TagBot:
25+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
926
runs-on: ubuntu-latest
1027
steps:
1128
- uses: JuliaRegistries/TagBot@v1
1229
with:
1330
token: ${{ secrets.GITHUB_TOKEN }}
31+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
version:
19-
- '1.10'
19+
- '1.11'
2020
os:
2121
- ubuntu-latest
2222
arch:
@@ -54,7 +54,7 @@ jobs:
5454
arch:
5555
- x64
5656
version:
57-
- '1.10'
57+
- '1.11'
5858
group:
5959
- 'basic_functional_group'
6060
steps:
@@ -96,7 +96,7 @@ jobs:
9696
arch:
9797
- x64
9898
version:
99-
- '1.10'
99+
- '1.11'
100100
group:
101101
- 'test_cases_group'
102102
steps:
@@ -139,7 +139,7 @@ jobs:
139139
os:
140140
- ubuntu-latest
141141
version:
142-
- '1.10'
142+
- '1.11'
143143
arch:
144144
- x64
145145
group:

Project.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "IncrementalInference"
22
uuid = "904591bb-b899-562f-9e6f-b8df64c7d480"
33
keywords = ["MM-iSAMv2", "Bayes tree", "junction tree", "Bayes network", "variable elimination", "graphical models", "SLAM", "inference", "sum-product", "belief-propagation"]
44
desc = "Implements the Multimodal-iSAMv2 algorithm."
5-
version = "0.35.4"
5+
version = "0.35.5"
66

77
[deps]
88
ApproxManifoldProducts = "9bbbb610-88a1-53cd-9763-118ce10c1f89"
@@ -65,13 +65,13 @@ IncrInfrInterpolationsExt = "Interpolations"
6565

6666
[compat]
6767
AMD = "0.5"
68-
ApproxManifoldProducts = "0.7, 0.8"
68+
ApproxManifoldProducts = "0.9"
6969
BSON = "0.2, 0.3"
7070
Combinatorics = "1.0"
7171
DataStructures = "0.16, 0.17, 0.18"
7272
DelimitedFiles = "1"
7373
DifferentialEquations = "7"
74-
DistributedFactorGraphs = "0.23, 0.24"
74+
DistributedFactorGraphs = "0.25"
7575
Distributions = "0.24, 0.25"
7676
DocStringExtensions = "0.8, 0.9"
7777
FileIO = "1"
@@ -85,15 +85,15 @@ JSON3 = "1"
8585
KernelDensityEstimate = "0.5.6"
8686
LinearAlgebra = "1.10"
8787
ManifoldDiff = "0.3"
88-
Manifolds = "0.9.12"
88+
Manifolds = "0.10"
8989
ManifoldsBase = "0.15"
90-
Manopt = "0.4.40"
91-
MetaGraphs = "0.7"
90+
Manopt = "0.4.40, 0.5"
91+
MetaGraphs = "0.7, 0.8"
9292
Optim = "1"
9393
OrderedCollections = "1"
9494
PrecompileTools = "1"
9595
ProgressMeter = "1"
96-
RecursiveArrayTools = "2.31.1, 3"
96+
RecursiveArrayTools = "3"
9797
Reexport = "1"
9898
SparseDiffTools = "2"
9999
StaticArrays = "1"

ext/HeatmapSampler.jl

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,16 @@ end
160160

161161
# Helper function to construct HGD
162162
function HeatmapGridDensity(
163-
data::AbstractMatrix{<:Real},
163+
# NAME SUGGESTION: SAMPLEABLE_FIELD, GenericField
164+
field_on_grid::AbstractMatrix{<:Real},
164165
domain::Tuple{<:AbstractVector{<:Real}, <:AbstractVector{<:Real}},
166+
# encapsulate above
165167
hint_callback::Union{<:Function, Nothing} = nothing,
166168
bw_factor::Real = 0.7; # kde spread between domain points
167169
N::Int = 10000,
168170
)
169171
#
170-
pos, weights_ = sampleHeatmap(data, domain..., 0)
172+
pos, weights_ = sampleHeatmap(field_on_grid, domain..., 0)
171173
# recast to the appropriate shape
172174
@cast support_[i, j] := pos[j][i]
173175

@@ -178,9 +180,9 @@ function HeatmapGridDensity(
178180

179181
@cast vec_preIS[j][i] := pts_preIS[i, j]
180182

181-
# weight the intermediate samples according to interpolation of raw data
183+
# weight the intermediate samples according to interpolation of raw field_on_grid
182184
# interpolated heatmap
183-
hm = Interpolations.linear_interpolation(domain, data) # depr .LinearInterpolation(..)
185+
hm = Interpolations.linear_interpolation(domain, field_on_grid) # depr .LinearInterpolation(..)
184186
d_scalar = Vector{Float64}(undef, length(vec_preIS))
185187

186188
# interpolate d_scalar for intermediate test points
@@ -204,7 +206,7 @@ function HeatmapGridDensity(
204206
density = ManifoldKernelDensity(TranslationGroup(Ndim(bel)), bel)
205207

206208
# return `<:SamplableBelief` object
207-
return HeatmapGridDensity(data, domain, hint_callback, bw_factor, density)
209+
return HeatmapGridDensity(field_on_grid, domain, hint_callback, bw_factor, density)
208210
end
209211

210212
function Base.isapprox(
@@ -225,7 +227,7 @@ end
225227

226228
# legacy construct helper
227229
function LevelSetGridNormal(
228-
data::AbstractMatrix{<:Real},
230+
field_on_grid::AbstractMatrix{<:Real},
229231
domain::Tuple{<:AbstractVector{<:Real}, <:AbstractVector{<:Real}},
230232
level::Real,
231233
sigma::Real;
@@ -235,8 +237,18 @@ function LevelSetGridNormal(
235237
N::Int = 10000,
236238
)
237239
#
238-
hgd = HeatmapGridDensity(data, domain, hint_callback, bw_factor; N = N)
239-
return LevelSetGridNormal(level, sigma, float(sigma_scale), hgd)
240+
field = HeatmapGridDensity(field_on_grid, domain, hint_callback, bw_factor; N = N)
241+
return LevelSetGridNormal(level, sigma, float(sigma_scale), field)
240242
end
241243

244+
# Field: domain (R^2/3), image (R^1/n scalar or tensor) e.g.: x,y -> elevation ;; x, y, z, t -> EM-field (R^(4x4))
245+
# Field( grid_x, grid_y,.... field_grid )
246+
# Field^ = interpolator(field_at_grid, grid)
247+
#
248+
# FieldGrid(data_on_grid, grid_domain) # internally does interpolation vodoo (same as Field^)
249+
# BeliefGrid <: FieldGrid
250+
# BeliefGrid(field_data: FieldGrid, measurement: Normal(mean: image_domain, cov: image_domain^2) ) -> domain, R_0+
251+
#
252+
# calcApproxLoss(ref::BeliefGrid, appr::ManifoldKernelDensity)::Field{Real}
253+
# ref = Normal(ScalarField - measurement, cov)
242254
#

src/Factors/GenericFunctions.jl

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,59 @@ function (cf::CalcFactor{<:ManifoldFactor})(X, p, q)
9999
return distanceTangent2Point(cf.factor.M, X, p, q)
100100
end
101101

102+
103+
## ======================================================================================
104+
## adjoint factor - adjoint action applied to the measurement
105+
## ======================================================================================
106+
107+
108+
# Adjoints defined in ApproxManifoldProducts
109+
struct AdFactor{F <: AbstractManifoldMinimize} <: AbstractManifoldMinimize
110+
factor::F
111+
end
112+
113+
function (cf::CalcFactor{<:AdFactor})(Xϵ, p, q)
114+
# M = getManifold(cf.factor)
115+
# p,q ∈ M
116+
# Xϵ ∈ TϵM
117+
# ϵ = identity_element(M)
118+
# transform measurement from TϵM to TpM (global to local coordinates)
119+
# Adₚ⁻¹ = AdjointMatrix(M, p)⁻¹ = AdjointMatrix(M, p⁻¹)
120+
# Xp = Adₚ⁻¹ * Xϵᵛ
121+
# ad = Ad(M, inv(M, p))
122+
# Xp = Ad(M, inv(M, p), Xϵ)
123+
# Xp = adjoint_action(M, inv(M, p), Xϵ)
124+
#TODO is vector transport supposed to be the same?
125+
# Xp = vector_transport_to(M, ϵ, Xϵ, p)
126+
127+
# Transform measurement covariance
128+
# ᵉΣₚ = Adₚ ᵖΣₚ Adₚᵀ
129+
#TODO test if transforming sqrt_iΣ is the same as Σ
130+
# Σ = ad * inv(cf.sqrt_iΣ^2) * ad'
131+
# sqrt_iΣ = convert(typeof(cf.sqrt_iΣ), sqrt(inv(Σ)))
132+
# sqrt_iΣ = convert(typeof(cf.sqrt_iΣ), ad * cf.sqrt_iΣ * ad')
133+
Xp =
134+
135+
child_cf = CalcFactorResidual(
136+
cf.faclbl,
137+
cf.factor.factor,
138+
cf.varOrder,
139+
cf.varOrderIdxs,
140+
cf.meas,
141+
cf.sqrt_iΣ,
142+
cf.cache,
143+
)
144+
return child_cf(Xp, p, q)
145+
end
146+
147+
getMeasurementParametric(f::AdFactor) = getMeasurementParametric(f.factor)
148+
149+
getManifold(f::AdFactor) = getManifold(f.factor)
150+
function getSample(cf::CalcFactor{<:AdFactor})
151+
M = getManifold(cf)
152+
return sampleTangent(M, cf.factor.factor.Z)
153+
end
154+
102155
## ======================================================================================
103156
## ManifoldPrior
104157
## ======================================================================================

src/Serialization/services/SerializingDistributions.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ function unpackDistribution(dtr::PackedZeroMeanDiagNormal)
2424
return MvNormal(LinearAlgebra.Diagonal(map(abs2, sqrt.(dtr.diag))))
2525
end # sqrt.(dtr.diag)
2626
function unpackDistribution(dtr::PackedZeroMeanFullNormal)
27-
return MvNormal(reshape(dtr.cov, length(dtr.mu), :))
27+
d = round(Int,sqrt(size(dtr.cov)[1]))
28+
return MvNormal(reshape(dtr.cov, d, d))
2829
end
2930
unpackDistribution(dtr::PackedDiagNormal) = MvNormal(dtr.mu, sqrt.(dtr.diag))
3031
function unpackDistribution(dtr::PackedFullNormal)

src/parametric/services/ParametricManopt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ function getSparsityPattern(fg, varLabels, factLabels)
259259

260260
vdims = getDimension.(getVariable.(fg, biadj.varLabels))
261261
fdims = getDimension.(getFactor.(fg, biadj.facLabels))
262-
262+
263263
c_end = cumsum(vdims)
264264
r_end = cumsum(fdims)
265265

@@ -272,7 +272,7 @@ function getSparsityPattern(fg, varLabels, factLabels)
272272
vec(CartesianIndices((R_range[R], C_range[C])))
273273
end)
274274

275-
vec(CartesianIndices((R_range[2], C_range[1])))
275+
# vec(CartesianIndices((R_range[2], C_range[1])))
276276

277277
return sparse(getindex.(iter,1), getindex.(iter,2), ones(Bool, length(iter)))
278278
end

src/services/FGOSUtils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function manikde!(
119119
variableType::Union{InstanceType{<:InferenceVariable}, InstanceType{<:AbstractFactor}},
120120
pts::AbstractVector{P};
121121
kw...,
122-
) where {P <: Union{<:AbstractArray, <:Number, <:Manifolds.ArrayPartition}}
122+
) where {P <: Union{<:AbstractArray, <:Number, <: ArrayPartition}}
123123
#
124124
M = getManifold(variableType)
125125
# @info "pts" P typeof(pts[1]) pts[1]

src/services/FactorGraph.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ end
104104
function setVal!(
105105
vd::VariableNodeData,
106106
val::AbstractVector{P},
107-
bw::Array{Float64, 2},
107+
bw::AbstractMatrix{Float64},
108108
) where {P}
109109
setVal!(vd, val)
110110
setBW!(vd, bw)
@@ -113,7 +113,7 @@ end
113113
function setVal!(
114114
v::DFGVariable,
115115
val::AbstractVector{P},
116-
bw::Array{Float64, 2};
116+
bw::AbstractMatrix{Float64};
117117
solveKey::Symbol = :default,
118118
) where {P}
119119
setVal!(v, val; solveKey = solveKey)
@@ -123,15 +123,15 @@ end
123123
function setVal!(
124124
vd::VariableNodeData,
125125
val::AbstractVector{P},
126-
bw::Vector{Float64},
126+
bw::AbstractVector{Float64},
127127
) where {P}
128128
setVal!(vd, val, reshape(bw, length(bw), 1))
129129
return nothing
130130
end
131131
function setVal!(
132132
v::DFGVariable,
133133
val::AbstractVector{P},
134-
bw::Vector{Float64};
134+
bw::AbstractVector{Float64};
135135
solveKey::Symbol = :default,
136136
) where {P}
137137
setVal!(getSolverData(v, solveKey), val, bw)

src/services/GraphInit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ function initVariable!(
391391
# TODO ArrayPartition inputs
392392
_prodrepr(pt) = pt
393393
# _prodrepr(pt::Tuple) = Manifolds.ProductRepr(pt...)
394-
_prodrepr(pt::Tuple) = Manifolds.ArrayPartition(pt...)
394+
_prodrepr(pt::Tuple) = ArrayPartition(pt...)
395395

396396
M = getManifold(vari)
397397
pp = manikde!(M, _prodrepr.(pts); bw)

0 commit comments

Comments
 (0)