-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
119 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Predefine a set of common problem instances. | ||
export setup_fh_l0, setup_fh_l1 | ||
|
||
function setup_fh_l0(; kwargs...) | ||
model, nls_model, _ = fh_model(; kwargs...) | ||
h = ProximalOperators.NormL0(1.0) | ||
return RegularizedNLPModel(model, h), RegularizedNLSModel(nls_model, h) | ||
end | ||
|
||
function setup_fh_l1(; kwargs...) | ||
model, nls_model, _ = fh_model(; kwargs...) | ||
h = ProximalOperators.NormL1(10.0) | ||
return RegularizedNLPModel(model, h), RegularizedNLSModel(nls_model, h) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Predefine a set of common problem instances. | ||
export setup_nnmf_l0, setup_nnmf_l1 | ||
|
||
function setup_nnmf_l0(args...; kwargs...) | ||
model, nls_model, _, selected = nnmf_model(args...) | ||
λ = norm(grad(model, rand(model.meta.nvar)), Inf) / 200 | ||
h = ProximalOperators.NormL0(λ) | ||
return RegularizedNLPModel(model, h, selected), RegularizedNLSModel(nls_model, h, selected) | ||
end | ||
|
||
function setup_nnmf_l1(args...; kwargs...) | ||
model, nls_model, _, selected = nnmf_model(args...) | ||
λ = norm(grad(model, rand(model.meta.nvar)), Inf) / 100_000 | ||
h = ProximalOperators.NormL1(λ) | ||
return RegularizedNLPModel(model, h, selected), RegularizedNLSModel(nls_model, h, selected) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Predefine a set of common problem instances. | ||
export setup_qp_rand_l1 | ||
|
||
function setup_qp_rand_l1(args...; kwargs...) | ||
model, nls_model, _ = qp_rand_model(args...; kwargs...) | ||
λ = 0.1 | ||
h = ProximalOperators.NormL1(λ) | ||
return RegularizedNLPModel(model, h), RegularizedNLSModel(nls_model, h) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Predefine a set of common problem instances. | ||
export setup_svm_train_lhalf, | ||
setup_svm_test_lhalf, setup_svm_train_l0, setup_svm_test_l0, setup_svm_train_l1, setup_svm_test_l1 | ||
|
||
function setup_svm_train_lhalf(args...; kwargs...) | ||
model, nls_model, _ = svm_train_model(args...) | ||
h = ShiftedProximalOperators.RootNormLhalf(0.1) | ||
return RegularizedNLPModel(model, h), RegularizedNLSModel(nls_model, h) | ||
end | ||
|
||
function setup_svm_test_lhalf(args...; kwargs...) | ||
model, nls_model, _ = svm_test_model(args...) | ||
h = ShiftedProximalOperators.RootNormLhalf(0.1) | ||
return RegularizedNLPModel(model, h), RegularizedNLSModel(nls_model, h) | ||
end | ||
|
||
function setup_svm_train_l0(args...; kwargs...) | ||
model, nls_model, _ = svm_train_model(args...) | ||
h = ProximalOperators.NormL0(0.1) | ||
return RegularizedNLPModel(model, h), RegularizedNLSModel(nls_model, h) | ||
end | ||
|
||
function setup_svm_test_l0(args...; kwargs...) | ||
model, nls_model, _ = svm_test_model(args...) | ||
h = ProximalOperators.NormL0(0.1) | ||
return RegularizedNLPModel(model, h), RegularizedNLSModel(nls_model, h) | ||
end | ||
|
||
function setup_svm_train_l1(args...; kwargs...) | ||
model, nls_model, _ = svm_train_model(args...) | ||
h = ProximalOperators.NormL1(0.1) | ||
return RegularizedNLPModel(model, h), RegularizedNLSModel(nls_model, h) | ||
end | ||
|
||
function setup_svm_test_l1(args...; kwargs...) | ||
model, nls_model, _ = svm_test_model(args...) | ||
h = ProximalOperators.NormL1(0.1) | ||
return RegularizedNLPModel(model, h), RegularizedNLSModel(nls_model, h) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters