Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DualTVDD.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephan Hilb
DualTVDD.jl
Commits
83261f3b
Commit
83261f3b
authored
Nov 27, 2023
by
Stephan Hilb
Browse files
Options
Downloads
Patches
Plain Diff
add readme and fix minor stuff
parent
b9e15c67
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+15
-0
15 additions, 0 deletions
README.md
scripts/run_experiments.jl
+9
-14
9 additions, 14 deletions
scripts/run_experiments.jl
with
24 additions
and
14 deletions
README.md
+
15
−
0
View file @
83261f3b
...
@@ -6,3 +6,18 @@ Read and use at your own risk.
...
@@ -6,3 +6,18 @@ Read and use at your own risk.
[1] Stephan Hilb and Andreas Langer. 'A General Decomposition Method
[1] Stephan Hilb and Andreas Langer. 'A General Decomposition Method
for a Convex Problem Related to Total Variation Minimization'. In preparation.
for a Convex Problem Related to Total Variation Minimization'. In preparation.
2022
2022
## Getting started
1.
`julia --project=scripts/`
2.
`]instantiate`
3.
execute statements in
`include("scripts/run.jl")`
. There is a memory leak
currently, so the Julia session should better be restarted after every
experiment.
### Running parallel scaling tests
1.
start Julia with e.g.
`julia -p 9 --project=scripts/`
2.
`@everywhere using Pkg`
3.
`@everywhere Pkg.activate("scripts/")`
4.
as above
This diff is collapsed.
Click to expand it.
scripts/run_experiments.jl
+
9
−
14
View file @
83261f3b
...
@@ -8,6 +8,7 @@ using CSV
...
@@ -8,6 +8,7 @@ using CSV
using
Colors
:
HSV
using
Colors
:
HSV
using
DataFrames
using
DataFrames
using
Distributed
using
Distributed
@everywhere
using
DualTVDD
@everywhere
using
DualTVDD
:
@everywhere
using
DualTVDD
:
DualTVL1ROFOpProblem
,
DualTVL1ROFOpProblem
,
DualTVDDAlgorithm
,
ChambolleAlgorithm
,
NStepAlgorithm
,
ProjGradAlgorithm
,
# TVNewtonAlgorithm,
DualTVDDAlgorithm
,
ChambolleAlgorithm
,
NStepAlgorithm
,
ProjGradAlgorithm
,
# TVNewtonAlgorithm,
...
@@ -60,7 +61,7 @@ function halve(img)
...
@@ -60,7 +61,7 @@ function halve(img)
return
res
return
res
end
end
# Problems
# Problem
Definition
s
function
DenoiseProblem
(
img
::
AbstractArray
{
T
,
d
};
λ
,
β
=
0.
)
where
{
T
,
d
}
function
DenoiseProblem
(
img
::
AbstractArray
{
T
,
d
};
λ
,
β
=
0.
)
where
{
T
,
d
}
B
=
(
1
+
β
)
*
I
B
=
(
1
+
β
)
*
I
...
@@ -73,9 +74,6 @@ function InpaintProblem(img::AbstractArray{T,d}, imgmask::AbstractArray{Bool,d};
...
@@ -73,9 +74,6 @@ function InpaintProblem(img::AbstractArray{T,d}, imgmask::AbstractArray{Bool,d};
pwop
=
imgmask
.+
β
.*
Ref
(
I
)
pwop
=
imgmask
.+
β
.*
Ref
(
I
)
B
=
Diagonal
(
vec
(
inv
.
(
pwop
)))
B
=
Diagonal
(
vec
(
inv
.
(
pwop
)))
## we grey-out the inpainting area.
## since β > 0 this actually matters and should be a sane default
#g = imgmask .* img .+ .!imgmask .* 0.5
g
=
imgmask
.*
img
g
=
imgmask
.*
img
return
DualTVL1ROFOpProblem
(
g
,
B
,
λ
)
return
DualTVL1ROFOpProblem
(
g
,
B
,
λ
)
end
end
...
@@ -280,21 +278,17 @@ function experiment_scaling_opticalflow(ctx)
...
@@ -280,21 +278,17 @@ function experiment_scaling_opticalflow(ctx)
ntimings
=
3
ntimings
=
3
prob
=
OptFlowProblem
(
f0
,
f1
;
λ
,
β
)
prob
=
OptFlowProblem
(
f0
,
f1
;
λ
,
β
)
#return prob
galg
=
ChambolleAlgorithm
(
prob
)
galg
=
ChambolleAlgorithm
(
prob
)
dalg
(
workers
)
=
alg_ddseq
(
workers
)
=
DualTVDDAlgorithm
(
prob
;
workers
,
M
,
overlap
,
ninner
,
parallel
=
false
,
σ
=
1.
,
subalg
=
x
->
ChambolleAlgorithm
(
x
))
DualTVDDAlgorithm
(
prob
;
alg_ddpar
(
workers
)
=
DualTVDDAlgorithm
(
prob
;
workers
,
M
,
overlap
,
ninner
,
parallel
=
true
,
σ
=
0.25
,
subalg
=
x
->
ChambolleAlgorithm
(
x
))
workers
,
M
,
overlap
,
ninner
,
parallel
=
false
,
σ
=
1.
,
subalg
=
x
->
ChambolleAlgorithm
(
x
))
function
timeit
(
alg
)
function
timeit
(
alg
)
# precompil
e
#
warmup for
precompil
ation
run_while
((
_
,
_
)
->
false
,
alg
)
run_while
((
_
,
_
)
->
false
,
alg
)
times
=
map
(
1
:
ntimings
)
do
_
times
=
map
(
1
:
ntimings
)
do
_
return
@elapsed
run_while
(
alg
)
do
st
,
k
return
@elapsed
run_while
(
alg
)
do
st
,
k
# min ~107
return
energy
(
fetch
(
st
),
prob
)
>
stopenergy
return
energy
(
fetch
(
st
),
prob
)
>
stopenergy
end
end
end
end
...
@@ -311,13 +305,14 @@ function experiment_scaling_opticalflow(ctx)
...
@@ -311,13 +305,14 @@ function experiment_scaling_opticalflow(ctx)
nparallel
%
nw
==
0
||
continue
nparallel
%
nw
==
0
||
continue
push!
(
df
,
(
push!
(
df
,
(
nworkers
=
nw
,
nworkers
=
nw
,
time
=
timeit
(
dalg
(
ws
[
1
:
nw
]))))
time_ddseq
=
timeit
(
alg_ddseq
(
ws
[
1
:
nw
])),
time_ddpar
=
timeit
(
alg_ddpar
(
ws
[
1
:
nw
]))
))
end
end
display
(
df
)
display
(
df
)
CSV
.
write
(
joinpath
(
ctx
.
outdir
,
"timings.csv"
),
df
)
CSV
.
write
(
joinpath
(
ctx
.
outdir
,
"timings.csv"
),
df
)
#saveimg(joinpath(ctx.outdir, "output_glob.png"), fetch_u(states.glob))
savedata
(
joinpath
(
ctx
.
outdir
,
"data.tex"
);
savedata
(
joinpath
(
ctx
.
outdir
,
"data.tex"
);
lambda
=
λ
,
beta
=
β
,
Mdir
,
M
=
prod
(
M
),
lambda
=
λ
,
beta
=
β
,
Mdir
,
M
=
prod
(
M
),
ntimings
,
stopenergy
,
ninner
,
ntimings
,
stopenergy
,
ninner
,
...
@@ -372,7 +367,7 @@ function _experiment_surrogate_outerinner(ctx, ref)
...
@@ -372,7 +367,7 @@ function _experiment_surrogate_outerinner(ctx, ref)
#residual = residual(fetch(state), prob),
#residual = residual(fetch(state), prob),
)
)
end
end
display
(
df
)
#
display(df)
CSV
.
write
(
joinpath
(
ctx
.
outdir
,
"energies.csv"
),
df
)
CSV
.
write
(
joinpath
(
ctx
.
outdir
,
"energies.csv"
),
df
)
#saveimg(joinpath(ctx.outdir, "output_glob.png"), fetch_u(states.glob))
#saveimg(joinpath(ctx.outdir, "output_glob.png"), fetch_u(states.glob))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment