Skip to content

Commit

Permalink
adapt documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobAsslaender committed Dec 5, 2023
1 parent 5bb0cd8 commit b668237
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 67 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,13 @@ jobs:
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.add("LinearOperatorCollection")
Pkg.add("Wavelets")
Pkg.instantiate()'
- run: |
julia --project=docs -e '
using Documenter: doctest
using Documenter: DocMeta, doctest
using RegularizedLeastSquares
doctest(RegularizedLeastSquares)' # change MYPACKAGE to the name of your package
DocMeta.setdocmeta!(RegularizedLeastSquares, :DocTestSetup, :(using RegularizedLeastSquares); recursive=true)
doctest(RegularizedLeastSquares)'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
7 changes: 6 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
LinearOperatorCollection = "a4a2c56f-fead-462a-a3ab-85921a5f2575"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
RegularizedLeastSquares = "1e9c538a-f78c-5de5-8ffb-0b6dbe892d23"
UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228"
Wavelets = "29a6e085-ba6d-5f35-a997-948ac2efa89a"

[compat]
Documenter = "0.25"
Documenter = "1.0, 1.1, 1.2"
14 changes: 10 additions & 4 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
using Documenter, RegularizedLeastSquares, LinearOperatorCollection, Wavelets

makedocs(
format = Documenter.HTML(prettyurls = false),
format = Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://github.com/JuliaImageRecon/RegularizedLeastSquares.jl",
assets=String[],
),
repo="https://github.com/JuliaImageRecon/RegularizedLeastSquares.jl/blob/{commit}{path}#{line}",
modules = [RegularizedLeastSquares],
sitename = "RegularizedLeastSquares.jl",
authors = "Tobias Knopp, Mirco Grosser, Martin Möddel, Niklas Hackelberg",
authors = "Tobias Knopp, Mirco Grosser, Martin Möddel, Niklas Hackelberg, Andrew Mao, Jakob Assländer",
pages = [
"Home" => "index.md",
"Getting Started" => "gettingStarted.md",
Expand All @@ -15,7 +20,8 @@ makedocs(

],
pagesonly = true,
checkdocs = :none
checkdocs = :none,
doctest = true
)

deploydocs(repo = "github.com/JuliaImageRecon/RegularizedLeastSquares.jl.git")
deploydocs(repo = "github.com/JuliaImageRecon/RegularizedLeastSquares.jl.git", push_preview = true)
21 changes: 10 additions & 11 deletions docs/src/API/regularization.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# API
# API for Regularizers
This page contains documentation of the public API of the RegularizedLeastSquares. In the Julia
REPL one can access this documentation by entering the help mode with `?`

## General
```@docs
RegularizedLeastSquares.prox!(::AbstractParameterizedRegularization, ::AbstractArray)
RegularizedLeastSquares.norm(::AbstractParameterizedRegularization, ::AbstractArray)
RegularizedLeastSquares.λ(::AbstractParameterizedRegularization)
RegularizedLeastSquares.prox!(::Type{<:AbstractParameterizedRegularization}, ::Any, ::Any)
RegularizedLeastSquares.norm(::Type{<:AbstractParameterizedRegularization}, ::Any, ::Any)
```

## Parameterized Regularization
```@docs
RegularizedLeastSquares.L1Regularization
RegularizedLeastSquares.L2Regularization
Expand Down Expand Up @@ -51,4 +41,13 @@ RegularizedLeastSquares.MaskedRegularization
RegularizedLeastSquares.TransformedRegularization
RegularizedLeastSquares.ConstraintTransformedRegularization
RegularizedLeastSquares.PlugAndPlayRegularization
```

## Miscellaneous Functions
```@docs
RegularizedLeastSquares.prox!(::AbstractParameterizedRegularization, ::AbstractArray)
RegularizedLeastSquares.prox!(::Type{<:AbstractParameterizedRegularization}, ::Any, ::Any)
RegularizedLeastSquares.norm(::AbstractParameterizedRegularization, ::AbstractArray)
RegularizedLeastSquares.λ(::AbstractParameterizedRegularization)
RegularizedLeastSquares.norm(::Type{<:AbstractParameterizedRegularization}, ::Any, ::Any)
```
25 changes: 10 additions & 15 deletions docs/src/API/solvers.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,52 @@
# API
# API for Solvers
This page contains documentation of the public API of the RegularizedLeastSquares. In the Julia
REPL one can access this documentation by entering the help mode with `?`

## General
## solve
```@docs
RegularizedLeastSquares.linearSolverList
RegularizedLeastSquares.createLinearSolver
RegularizedLeastSquares.solve(::AbstractLinearSolver, ::Any)
RegularizedLeastSquares.SolverInfo
RegularizedLeastSquares.applicableSolverList
RegularizedLeastSquares.isapplicable
```

## ADMM
```@docs
RegularizedLeastSquares.ADMM
RegularizedLeastSquares.solve(::ADMM, ::Any)
```

## CGNR
```@docs
RegularizedLeastSquares.CGNR
RegularizedLeastSquares.solve(::CGNR, ::Any)
```

## Kaczmarz
```@docs
RegularizedLeastSquares.Kaczmarz
RegularizedLeastSquares.solve(::Kaczmarz, ::Vector{Any})
```

## FISTA
```@docs
RegularizedLeastSquares.FISTA
RegularizedLeastSquares.solve(::FISTA, ::Any)
```

## OptISTA
```@docs
RegularizedLeastSquares.OptISTA
RegularizedLeastSquares.solve(::OptISTA, ::Any)
```

## POGM
```@docs
RegularizedLeastSquares.POGM
RegularizedLeastSquares.solve(::POGM, ::Any)
```

## SplitBregman
```@docs
RegularizedLeastSquares.SplitBregman
RegularizedLeastSquares.solve(::SplitBregman, ::Any)
```

## Direct
## Miscellaneous Functions
```@docs
RegularizedLeastSquares.linearSolverList
RegularizedLeastSquares.createLinearSolver
RegularizedLeastSquares.SolverInfo
RegularizedLeastSquares.applicableSolverList
RegularizedLeastSquares.isapplicable
```
21 changes: 0 additions & 21 deletions docs/src/examples/ex_cs.jl

This file was deleted.

22 changes: 11 additions & 11 deletions src/Regularization/ScaledRegularization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ export AbstractScaledRegularization
"""
AbstractScaledRegularization
Nested regularization term that applies a `factor` to the regularization parameter `λ` of its `inner` term.
Nested regularization term that applies a `scalefactor` to the regularization parameter `λ` of its `inner` term.
See also [`factor`](@ref), [`λ`](@ref), [`innerreg`](@ref).
See also [`scalefactor`](@ref), [`λ`](@ref), [`innerreg`](@ref).
"""
abstract type AbstractScaledRegularization{T, S<:AbstractParameterizedRegularization{T}} <: AbstractNestedRegularization{S} end
"""
scalefactor(reg::AbstractScaledRegularization)
scalescalefactor(reg::AbstractScaledRegularization)
return the scaling `factor` for `λ`
return the scaling `scalefactor` for `λ`
"""
scalefactor(::R) where R <: AbstractScaledRegularization = error("Scaled regularization term $R must implement factor")
scalefactor(::R) where R <: AbstractScaledRegularization = error("Scaled regularization term $R must implement scalefactor")

Check warning on line 15 in src/Regularization/ScaledRegularization.jl

View check run for this annotation

Codecov / codecov/patch

src/Regularization/ScaledRegularization.jl#L15

Added line #L15 was not covered by tests
"""
λ(reg::AbstractScaledRegularization)
return `λ` of `inner` regularization term scaled by `scalefactor(reg)`.
See also [`factor`](@ref), [`innerreg`](@ref).
See also [`scalefactor`](@ref), [`innerreg`](@ref).
"""
λ(reg::AbstractScaledRegularization) = λ(innerreg(reg)) * scalefactor(reg)

Expand All @@ -36,7 +36,7 @@ export FixedParameterRegularization
"""
FixedParameterRegularization
Nested regularization term that discards any `λ` passed to it and instead uses `λ` from its inner regularization term. This can be used to selectively disallow normalization.
Nested regularization term that discards any `λ` passed to it and instead uses `λ` from its inner regularization term. This can be used to selectively disallow normalization.
"""
struct FixedParameterRegularization{T, S, R} <: AbstractScaledRegularization{T, S}
reg::R
Expand All @@ -61,16 +61,16 @@ innerreg(reg::AutoScaledRegularization) = reg.reg
# A bit hacky: Factor can only be computed once x is seen, therefore hide factor in λ and silently add it in prox!/norm calls
scalefactor(reg::AutoScaledRegularization) = isnothing(reg.factor) ? 1.0 : reg.factor
function prox!(reg::AutoScaledRegularization, x, λ)
if isnothing(reg.factor)
initFactor!(reg, x)
if isnothing(reg.factor)
initFactor!(reg, x)

Check warning on line 65 in src/Regularization/ScaledRegularization.jl

View check run for this annotation

Codecov / codecov/patch

src/Regularization/ScaledRegularization.jl#L64-L65

Added lines #L64 - L65 were not covered by tests
return prox!(reg.reg, x, λ * reg.factor)
else
return prox!(reg.reg, x, λ)
end
end
function norm(reg::AutoScaledRegularization, x, λ)
if isnothing(reg.factor)
initFactor!(reg, x)
if isnothing(reg.factor)
initFactor!(reg, x)

Check warning on line 73 in src/Regularization/ScaledRegularization.jl

View check run for this annotation

Codecov / codecov/patch

src/Regularization/ScaledRegularization.jl#L72-L73

Added lines #L72 - L73 were not covered by tests
return norm(reg.reg, x, λ * reg.factor)
else
return norm(reg.reg, x, λ)
Expand Down

0 comments on commit b668237

Please sign in to comment.