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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephan Hilb
DualTVDD.jl
Commits
f0526296
Commit
f0526296
authored
4 years ago
by
Stephan Hilb
Browse files
Options
Downloads
Patches
Plain Diff
add latent changes
parent
91eb8523
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/chambolle.jl
+0
-16
0 additions, 16 deletions
src/chambolle.jl
src/dualtvdd.jl
+2
-3
2 additions, 3 deletions
src/dualtvdd.jl
src/problems.jl
+29
-2
29 additions, 2 deletions
src/problems.jl
with
31 additions
and
21 deletions
src/chambolle.jl
+
0
−
16
View file @
f0526296
...
...
@@ -105,19 +105,3 @@ function step!(ctx::ChambolleState)
end
fetch
(
ctx
::
ChambolleState
)
=
ctx
.
p
function
recover_u
(
p
,
md
::
DualTVL1ROFOpProblem
)
d
=
ndims
(
md
.
g
)
u
=
similar
(
md
.
g
)
v
=
similar
(
md
.
g
)
@inline
kfΛ
(
w
)
=
@inbounds
divergence
(
w
)
kΛ
=
Kernel
{
ntuple
(
_
->-
1
:
1
,
d
)}(
kfΛ
)
# v = div(p) + A'*f
map!
(
kΛ
,
v
,
StaticKernels
.
extend
(
p
,
StaticKernels
.
ExtensionNothing
()))
# extension: nothing
v
.+=
md
.
g
# u = B * v
mul!
(
vec
(
u
),
md
.
B
,
vec
(
v
))
return
u
end
This diff is collapsed.
Click to expand it.
src/dualtvdd.jl
+
2
−
3
View file @
f0526296
...
...
@@ -70,14 +70,13 @@ end
function
step!
(
ctx
::
DualTVDDState
)
alg
=
ctx
.
algorithm
# σ = 1 takes care of sequential updates
σ
=
alg
.
parallel
?
ctx
.
algorithm
.
σ
:
1.
σ
=
ctx
.
algorithm
.
σ
d
=
ndims
(
ctx
.
p
)
ax
=
axes
(
ctx
.
p
)
overlap
=
ctx
.
algorithm
.
overlap
# call run! on each cell (this can be threaded)
Threads
.
@threads
for
i
in
eachindex
(
ctx
.
subax
)
for
i
in
eachindex
(
ctx
.
subax
)
sax
=
ctx
.
subax
[
i
]
li
=
LinearIndices
(
ctx
.
subax
)[
i
]
sg
=
ctx
.
subctx
[
i
]
.
algorithm
.
problem
.
g
# julia-bug workaround
...
...
This diff is collapsed.
Click to expand it.
src/problems.jl
+
29
−
2
View file @
f0526296
...
...
@@ -26,9 +26,36 @@ function energy(p, prob::DualTVL1ROFOpProblem)
# v = div(p) + g
v
=
map
(
kΛ
,
extend
(
p
,
ExtensionNothing
()))
# |v|_B^2
/ 2
# |v|_B^2
u
=
prob
.
B
*
vec
(
v
)
return
sum
(
dot
.
(
u
,
vec
(
v
)))
/
2
return
sum
(
dot
.
(
u
,
vec
(
v
)))
end
function
recover_u
(
p
,
prob
::
DualTVL1ROFOpProblem
)
d
=
ndims
(
prob
.
g
)
u
=
similar
(
prob
.
g
)
v
=
similar
(
prob
.
g
)
@inline
kfΛ
(
w
)
=
@inbounds
divergence
(
w
)
kΛ
=
Kernel
{
ntuple
(
_
->-
1
:
1
,
d
)}(
kfΛ
)
# v = div(p) + A'*f
map!
(
kΛ
,
v
,
StaticKernels
.
extend
(
p
,
StaticKernels
.
ExtensionNothing
()))
# extension: nothing
v
.+=
prob
.
g
# u = B * v
mul!
(
vec
(
u
),
prob
.
B
,
vec
(
v
))
return
u
end
function
residual
(
p
,
prob
::
DualTVL1ROFOpProblem
)
d
=
ndims
(
p
)
grad
=
Kernel
{
ntuple
(
_
->
0
:
1
,
d
)}(
gradient
)
u
=
recover_u
(
p
,
prob
)
q
=
map
(
grad
,
StaticKernels
.
extend
(
u
,
StaticKernels
.
ExtensionReplicate
()))
res
=
q
.-
norm
.
(
q
)
.*
p
./
prob
.
λ
return
sum
(
dot
.
(
res
,
res
))
/
length
(
p
)
end
# operator norm of B
...
...
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