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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephan Hilb
SemiSmoothNewton.jl
Commits
c528bdf9
Commit
c528bdf9
authored
Jan 17, 2022
by
Stephan Hilb
Browse files
Options
Downloads
Patches
Plain Diff
cleanup
parent
b8c4ac14
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/run_experiments.jl
+17
-65
17 additions, 65 deletions
scripts/run_experiments.jl
with
17 additions
and
65 deletions
scripts/run_experiments.jl
+
17
−
65
View file @
c528bdf9
...
@@ -917,12 +917,9 @@ function optflow(ctx)
...
@@ -917,12 +917,9 @@ function optflow(ctx)
ctx
.
params
.
alpha1
,
ctx
.
params
.
alpha2
,
ctx
.
params
.
lambda
,
ctx
.
params
.
beta
,
ctx
.
params
.
alpha1
,
ctx
.
params
.
alpha2
,
ctx
.
params
.
lambda
,
ctx
.
params
.
beta
,
ctx
.
params
.
gamma1
,
ctx
.
params
.
gamma2
)
ctx
.
params
.
gamma1
,
ctx
.
params
.
gamma2
)
u_acc
=
FeFunction
(
st
.
u
.
space
,
name
=
"u_acc"
)
u_acc
.
data
.=
0
function
warp!
()
function
warp!
()
# warp image into imgfw / fw
# warp image into imgfw / fw
imgfw
=
warp_backwards
(
imgf1
,
sample
(
u_acc
))
imgfw
=
warp_backwards
(
imgf1
,
sample
(
st
.
u
))
project_l2_pixel!
(
fw
,
imgfw
)
project_l2_pixel!
(
fw
,
imgfw
)
# recompute optflow operator T based on u0 and fw
# recompute optflow operator T based on u0 and fw
...
@@ -947,12 +944,10 @@ function optflow(ctx)
...
@@ -947,12 +944,10 @@ function optflow(ctx)
project_l2_pixel!
(
f1
,
imgf1
)
project_l2_pixel!
(
f1
,
imgf1
)
end
end
interpolate_image_data!
()
warp!
()
# just to fill st.g
save_step
(
i
)
=
save_step
(
i
)
=
output
(
st
,
joinpath
(
ctx
.
outdir
,
"output_
$
(lpad(i, 5, '0')).vtu"
),
output
(
st
,
joinpath
(
ctx
.
outdir
,
"output_
$
(lpad(i, 5, '0')).vtu"
),
st
.
g
,
st
.
u
,
st
.
p1
,
st
.
p2
,
st
.
est
,
f0
,
f1
,
fw
,
u_acc
)
st
.
g
,
st
.
u
,
st
.
p1
,
st
.
p2
,
st
.
est
,
f0
,
f1
,
fw
)
i
=
0
i
=
0
pvd
=
paraview_collection
(
joinpath
(
ctx
.
outdir
,
"output.pvd"
))
do
pvd
pvd
=
paraview_collection
(
joinpath
(
ctx
.
outdir
,
"output.pvd"
))
do
pvd
...
@@ -962,6 +957,10 @@ function optflow(ctx)
...
@@ -962,6 +957,10 @@ function optflow(ctx)
#norm_g_old = norm_l2(st.g)
#norm_g_old = norm_l2(st.g)
for
j
in
1
:
5
for
j
in
1
:
5
println
(
"interpolate image data ..."
)
interpolate_image_data!
()
println
(
"warp ..."
)
warp!
()
# in the first step just to fill st.g
i
+=
1
i
+=
1
# interior newton loop
# interior newton loop
...
@@ -984,69 +983,22 @@ function optflow(ctx)
...
@@ -984,69 +983,22 @@ function optflow(ctx)
#display(plot(colorflow(to_img(sample(st.u)); ctx.params.maxflow)))
#display(plot(colorflow(to_img(sample(st.u)); ctx.params.maxflow)))
end
end
#estimate!(st)
display
(
plot
(
colorflow
(
to_img
(
sample
(
st
.
u
));
ctx
.
params
.
maxflow
)))
#pvd[i] = save_step(i)
u_acc
.
data
.=
st
.
u
.
data
display
(
plot
(
colorflow
(
to_img
(
sample
(
u_acc
));
ctx
.
params
.
maxflow
)))
# poor man's hash
#println(integrate(st.mesh, (x; tdata) -> tdata; st.tdata))
#println("refine ...")
##marked_cells = mark(st; theta = 0.5)
#marked_cells = Set(axes(mesh.cells, 2))
#mesh, fs = refine(mesh, marked_cells;
# st.est, st.g, st.u, st.p1, st.p2, st.du, st.dp1, st.dp2,
# f0, f1, fw, u_acc)
#st = L1L2TVState(mesh, st.d, st.m, T, nabla(fs.fw), S,
# st.alpha1, st.alpha2, st.beta, st.lambda, st.gamma1, st.gamma2,
# fs.est, fs.g, fs.u, fs.p1, fs.p2, fs.du, fs.dp1, fs.dp2)
#f0, f1, fw, u_acc = (fs.f0, fs.f1, fs.fw, fs.u_acc)
#i += 1
#println("interpolate image data ...")
#interpolate_image_data!()
println
(
"warp ..."
)
##warp!() # yay
estimate!
(
st
)
estimate!
(
st
)
pvd
[
i
]
=
save_step
(
i
)
pvd
[
i
]
=
save_step
(
i
)
#u_acc.data .= st.u.data
println
(
"refine ..."
)
warp!
()
# yay
marked_cells
=
mark
(
st
;
theta
=
0.5
)
end
#warp!()
#norm_g = norm_l2(st.g)
#i += 1
#pvd[i] = save_step(i)
#i >= 50 && break
#continue
#marked_cells = mark(st; theta = 0.5)
#marked_cells = Set(axes(mesh.cells, 2))
#marked_cells = Set(axes(mesh.cells, 2))
mesh
,
fs
=
refine
(
mesh
,
marked_cells
;
#println("refining ...")
st
.
est
,
st
.
g
,
st
.
u
,
st
.
p1
,
st
.
p2
,
st
.
du
,
st
.
dp1
,
st
.
dp2
,
st
.
tdata
,
f0
,
f1
,
fw
)
#mesh, fs = refine(mesh, marked_cells;
st
=
L1L2TVState
(
mesh
,
st
.
d
,
st
.
m
,
st
.
T
,
fs
.
tdata
,
st
.
S
,
# st.est, st.g, st.u, st.p1, st.p2, st.du, st.dp1, st.dp2,
st
.
alpha1
,
st
.
alpha2
,
st
.
beta
,
st
.
lambda
,
st
.
gamma1
,
st
.
gamma2
,
# f0, f1, fw)
fs
.
est
,
fs
.
g
,
fs
.
u
,
fs
.
p1
,
fs
.
p2
,
fs
.
du
,
fs
.
dp1
,
fs
.
dp2
)
#st = L1L2TVState(mesh, st.d, st.m, T, nabla(fs.fw), S,
f0
,
f1
,
fw
=
(
fs
.
f0
,
fs
.
f1
,
fs
.
fw
)
# st.alpha1, st.alpha2, st.beta, st.lambda, st.gamma1, st.gamma2,
end
# fs.est, fs.g, fs.u, fs.p1, fs.p2, fs.du, fs.dp1, fs.dp2)
#f0, f1, fw = (fs.f0, fs.f1, fs.fw)
# i += 1
# pvd[i] = save_step(i)
#println("interpolate image data ...")
#interpolate_image_data!()
# i += 1
# pvd[i] = save_step(i)
end
end
#display(plot(colorflow(to_img(sample(st.u)); ctx.params.maxflow)))
#display(plot(colorflow(to_img(sample(st.u)); ctx.params.maxflow)))
...
...
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