Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SemiSmoothNewton.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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephan Hilb
SemiSmoothNewton.jl
Compare revisions
475c14ca8b582aa2a546ed02e2ed3bea29788964 to b85e4a9478fcedd5d8e811d1acc8600b41436b6b
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
stephan.hilb/SemiSmoothNewton.jl
Select target project
No results found
b85e4a9478fcedd5d8e811d1acc8600b41436b6b
Select Git revision
Swap
Target
stephan.hilb/SemiSmoothNewton.jl
Select target project
stephan.hilb/SemiSmoothNewton.jl
1 result
475c14ca8b582aa2a546ed02e2ed3bea29788964
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (5)
disable generating mesh.csv for inpainting experiment
· 792e848e
Stephan Hilb
authored
2 years ago
792e848e
fix primal-dual parameter choices
· 9ea038a8
Stephan Hilb
authored
2 years ago
9ea038a8
use nodal interpolation for inpaint and fine mesh
· 34bc097e
Stephan Hilb
authored
2 years ago
34bc097e
add experiment batch for first paper
· c33670b7
Stephan Hilb
authored
2 years ago
c33670b7
use nodal interpolation for optflow on image mesh
· b85e4a94
Stephan Hilb
authored
2 years ago
b85e4a94
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/run.jl
+19
-12
19 additions, 12 deletions
scripts/run.jl
scripts/run_experiments.jl
+24
-6
24 additions, 6 deletions
scripts/run_experiments.jl
with
43 additions
and
18 deletions
scripts/run.jl
View file @
b85e4a94
...
...
@@ -19,20 +19,27 @@ ctx(experiment_convergence_rate, "fem/convergence/rate")
# pd est, L1-TV, bad
#
application
s
#
misc experiment
s
# denoising
ctx
(
experiment_denoise
,
"fem/denoise"
)
# inpainting
# inpainting (OLD)
ctx
(
experiment_inpaint
,
"fem/inpaint"
)
# adaptive optical flow
ctx
(
experiment_optflow_middlebury_all
,
"fem/optflow/middlebury"
)
# additional experiments for paper
# combined inpainting + denoising with mixed noise
ctx
(
experiment_inpaint_denoise
,
"fem/optflow/inpaint_denoise"
)
# comparison: warping and adaptivity
ctx
(
experiment_optflow_middlebury_warping_comparison
,
"fem/optflow/middlebury_warping_comparison"
)
function
paper1
(
ctx
)
# newton vs other algs
ctx
(
experiment_convergence_rate
,
"fem/convergence/rate"
)
# denoising
ctx
(
experiment_denoise
,
"fem/denoise"
)
# combined inpainting + denoising with mixed noise
ctx
(
experiment_inpaint_denoise
,
"fem/inpaint_denoise"
)
# comparison: warping and adaptivity
ctx
(
experiment_optflow_middlebury_warping_comparison
,
"fem/opticalflow/middlebury_warping_comparison"
)
end
function
paper2
(
ctx
)
# comparison: warping and adaptivity
# TODO: adaptivity parameter?
ctx
(
experiment_optflow_middlebury_warping_comparison
,
"fem/opticalflow/middlebury_warping_comparison"
)
end
This diff is collapsed.
Click to expand it.
scripts/run_experiments.jl
View file @
b85e4a94
...
...
@@ -988,10 +988,12 @@ function denoise_pd(ctx)
# semi-implicit primal dual parameters
mu
=
st
.
alpha2
+
st
.
beta
# T = I, S = I
mu
/=
100
# kind of arbitrary?
#
mu /= 100 # kind of arbitrary?
tau
=
1e-1
L
=
norm_gradient
(
mesh
)
#tau = 1e-1
tau
=
1
/
L
#L = 100
sigma
=
inv
(
tau
*
L
^
2
)
theta
=
NaN
# initialized later
...
...
@@ -1022,6 +1024,7 @@ function denoise_pd(ctx)
while
true
k
+=
1
if
ctx
.
params
.
algorithm
==
:
pd1
theta
=
1
/
sqrt
(
1
+
2
*
mu
*
tau
)
# constant
# no step size control
step_pd2!
(
st
;
sigma
,
tau
,
theta
)
elseif
ctx
.
params
.
algorithm
==
:
pd2
...
...
@@ -1322,6 +1325,7 @@ function experiment_approximation(ctx)
end
# TODO: deduplicate, cf. optflow()
# NOTE: used also by inpaint_denoise experiment
function
inpaint
(
ctx
)
# expect ctx.params.g_arr
...
...
@@ -1350,13 +1354,15 @@ function inpaint(ctx)
if
ctx
.
params
.
n_refine
==
0
# if we use a grid at image resolution, we wan't to avoid
# information loss at all cost.
# projet_l2_pixel is not suited for inpainting as it is a global
# proje
c
t_l2_pixel is not suited for inpainting as it is a global
# operator, which may leak data from the inpainting domain
interpolate!
(
st
.
g
,
x
->
evaluate_bilinear
(
g_arr
,
x
))
interpolate!
(
st
.
tdata
,
x
->
evaluate_bilinear
(
mask_arr
,
x
))
else
project_image!
(
st
.
g
,
g_arr
)
# TODO: maybe a more conservative choice would be good
project_image!
(
st
.
tdata
,
mask_arr
)
end
project_image!
(
st
.
tdata
,
mask_arr
)
end
save_step
(
i
)
=
...
...
@@ -1427,7 +1433,7 @@ function inpaint(ctx)
u_sampled
=
sample
(
st
.
u
)
saveimg
(
joinpath
(
ctx
.
outdir
,
"g.png"
),
grayclamp
.
(
to_img
(
g_arr
)))
saveimg
(
joinpath
(
ctx
.
outdir
,
"output.png"
),
grayclamp
.
(
to_img
(
u_sampled
)))
save_csv
(
joinpath
(
ctx
.
outdir
,
"mesh.csv"
),
st
.
u
)
#
save_csv(joinpath(ctx.outdir, "mesh.csv"), st.u)
savedata
(
joinpath
(
ctx
.
outdir
,
"data.tex"
);
ctx
.
params
.
eps_newton
,
ctx
.
params
.
n_refine
,
st
.
alpha1
,
st
.
alpha2
,
st
.
lambda
,
st
.
beta
,
st
.
gamma1
,
st
.
gamma2
,
...
...
@@ -1495,7 +1501,12 @@ function optflow(ctx)
size
(
ctx
.
params
.
imgf0
)
==
size
(
ctx
.
params
.
imgf1
)
||
throw
(
ArgumentError
(
"non-matching image sizes"
))
project_image!
=
project_l2_lagrange!
#project_image! = project_l2_lagrange!
project_image!
(
f
,
img
)
=
ctx
.
params
.
n_refine
==
0
?
interpolate!
(
f
,
x
->
evaluate_bilinear
(
img
,
x
))
:
# fine mesh
project_l2_lagrange!
# coarse adaptive mesh
eps_newton
=
1e-3
# cauchy criterion for inner newton loop
eps_warp
=
0.05
...
...
@@ -1672,6 +1683,13 @@ function experiment_optflow_middlebury_warping_comparison(ctx)
warp
=
false
,
refine
=
false
,
n_refine
=
0
)
ctx
(
experiment_optflow_middlebury_all_benchmarks
,
"warping"
;
warp
=
true
,
refine
=
false
,
n_refine
=
0
)
end
function
experiment_optflow_middlebury_warping_comparison_adaptive
(
ctx
)
ctx
(
experiment_optflow_middlebury_all_benchmarks
,
"vanilla"
;
warp
=
false
,
refine
=
false
,
n_refine
=
0
)
ctx
(
experiment_optflow_middlebury_all_benchmarks
,
"warping"
;
warp
=
true
,
refine
=
false
,
n_refine
=
0
)
ctx
(
experiment_optflow_middlebury_all_benchmarks
,
"adaptive-warping"
;
warp
=
true
,
refine
=
true
,
n_refine
=
6
)
end
...
...
This diff is collapsed.
Click to expand it.