Skip to content

Commit 4e6bfff

Browse files
committed
better organize src files
1 parent 1061dbb commit 4e6bfff

15 files changed

+41
-36
lines changed

src/IncrementalInference.jl

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ using Logging
6060
using PrecompileTools
6161

6262
# bringing in BSD 3-clause ccolamd
63-
include("ccolamd.jl")
63+
include("services/ccolamd.jl")
6464
using SuiteSparse.CHOLMOD: SuiteSparse_long # For CCOLAMD constraints.
6565
using .Ccolamd
6666

@@ -120,8 +120,8 @@ include("ExportAPI.jl")
120120
# FIXME, move up to DFG
121121
# abstract type AbstractManifoldMinimize <: AbstractRelative end
122122

123-
#
124-
include("ManifoldsExtentions.jl")
123+
124+
125125
# regular
126126
include("entities/SolverParams.jl")
127127

@@ -133,10 +133,15 @@ include("Factors/GenericMarginal.jl")
133133
include("entities/AliasScalarSampling.jl")
134134
include("entities/OptionalDensities.jl")
135135
include("entities/BeliefTypes.jl")
136+
137+
#
138+
include("manifolds/services/ManifoldsExtentions.jl")
139+
include("manifolds/services/ManifoldSampling.jl")
140+
136141
include("entities/FactorGradients.jl")
137142

138143
# Statistics helpers on manifolds
139-
include("VariableStatistics.jl")
144+
include("services/VariableStatistics.jl")
140145

141146
# factors needed for belief propagation on the tree
142147
include("Factors/MsgPrior.jl")
@@ -201,44 +206,44 @@ include("services/ExplicitDiscreteMarginalizations.jl")
201206
include("services/EvalFactor.jl")
202207
include("services/ApproxConv.jl")
203208

204-
# FIXME CONSOLIDATE
205-
include("ConsolidateParametricRelatives.jl")
206209

207210
include("services/GraphProductOperations.jl")
208211
include("services/SolveTree.jl")
209212
include("services/TetherUtils.jl")
210213
include("services/TreeDebugTools.jl")
211214
include("CliqueStateMachine/services/CliqStateMachineUtils.jl")
212215

216+
# FIXME CONSOLIDATE
217+
include("parametric/services/ConsolidateParametricRelatives.jl")
213218
#EXPERIMENTAL parametric
214-
include("ParametricCSMFunctions.jl")
215-
include("ParametricUtils.jl")
216-
include("ParametricManoptDev.jl")
219+
include("parametric/services/ParametricCSMFunctions.jl")
220+
include("parametric/services/ParametricUtils.jl")
221+
include("parametric/services/ParametricOptim.jl")
222+
include("parametric/services/ParametricManoptDev.jl")
217223
include("services/MaxMixture.jl")
218224

219225
#X-stroke
220226
include("CliqueStateMachine/services/CliqueStateMachine.jl")
221227

222-
include("CanonicalGraphExamples.jl")
228+
include("services/CanonicalGraphExamples.jl")
223229

224230
include("services/AdditionalUtils.jl")
225-
include("SolverAPI.jl")
231+
include("services/SolverAPI.jl")
226232

227233
# Symbolic tree analysis files.
228-
include("AnalysisTools.jl")
234+
include("services/AnalysisTools.jl")
229235

230-
include("ManifoldSampling.jl")
231236

232237
# deprecation legacy support
233238
include("Deprecated.jl")
234239

235240
exportimg(pl) = error("Please do `using Gadfly` to allow image export.")
236241
function __init__()
237242
@require InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" include(
238-
"RequireInteractiveUtils.jl",
243+
"services/RequireInteractiveUtils.jl",
239244
)
240245
@require Gadfly = "c91e804a-d5a3-530f-b6f0-dfbca275c004" include(
241-
"EmbeddedPlottingUtils.jl",
246+
"services/EmbeddedPlottingUtils.jl",
242247
)
243248
@require DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa" include(
244249
"ODE/DERelative.jl",
File renamed without changes.

src/ManifoldsExtentions.jl renamed to src/manifolds/services/ManifoldsExtentions.jl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,6 @@ function Optim.project_tangent!(M::ManifoldWrapper, g, x)
2323
return g
2424
end
2525

26-
# experimental
27-
function optimizeManifold_FD(
28-
M::AbstractManifold,
29-
cost::Function,
30-
x0::AbstractArray;
31-
algorithm = Optim.ConjugateGradient(; manifold=ManifoldWrapper(M))
32-
)
33-
# finitediff setup
34-
r_backend = ManifoldDiff.TangentDiffBackend(
35-
ManifoldDiff.FiniteDifferencesBackend()
36-
)
37-
38-
## finitediff gradient (non-manual)
39-
function costgrad_FD!(X,p)
40-
X .= ManifoldDiff.gradient(M, cost, p, r_backend)
41-
X
42-
end
43-
44-
Optim.optimize(cost, costgrad_FD!, x0, algorithm)
45-
end
46-
4726

4827
## ================================================================================================
4928
## AbstractPowerManifold with N as field to avoid excessive compiling time.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
# experimental
3+
function optimizeManifold_FD(
4+
M::AbstractManifold,
5+
cost::Function,
6+
x0::AbstractArray;
7+
algorithm = Optim.ConjugateGradient(; manifold=ManifoldWrapper(M))
8+
)
9+
# finitediff setup
10+
r_backend = ManifoldDiff.TangentDiffBackend(
11+
ManifoldDiff.FiniteDifferencesBackend()
12+
)
13+
14+
## finitediff gradient (non-manual)
15+
function costgrad_FD!(X,p)
16+
X .= ManifoldDiff.gradient(M, cost, p, r_backend)
17+
X
18+
end
19+
20+
Optim.optimize(cost, costgrad_FD!, x0, algorithm)
21+
end
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)