Skip to content

Commit

Permalink
[README] clarify mode options (#55)
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Hanson <5846501+ericphanson@users.noreply.github.com>
  • Loading branch information
odow and ericphanson committed Apr 18, 2023
1 parent 2181b42 commit 78a903c
Showing 1 changed file with 35 additions and 28 deletions.
63 changes: 35 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,38 +74,45 @@ List of supported model attributes:

## Options

SDPA has 3 modes that give values to all 10 parameters. By default, we put SDPA
in the `PARAMETER_DEFAULT` mode.

The three modes are as follow:

| Mode | Name |
| ------- | ----------------------------- |
| Default | `SDPA.PARAMETER_DEFAULT` |
| Fast | `SDPA.PARAMETER_UNSTABLE_BUT_FAST` |
| Slow | `SDPA.PARAMETER_STABLE_BUT_SLOW` |

The following table gives the default value for each parameter.

| Parameter name | Default | Fast | Slow |
| -------------- | ------- | ------ | ------ |
| MaxIteration | 100 | 100 | 1000 |
| EpsilonStar | 1.0e-7 | 1.0e-7 | 1.0e-7 |
| LambdaStar | 1.0e+2 | 1.0e+2 | 1.0e+4 |
| OmegaStar | 2.0 | 2.0 | 2.0 |
| LowerBound | 1.0e+5 | 1.0e+5 | 1.0e+5 |
| UpperBound | 1.0e+5 | 1.0e+5 | 1.0e+5 |
| BetaStar | 0.1 | 0.01 | 0.1 |
| BetaBar | 0.2 | 0.02 | 0.3 |
| GammaStar | 0.9 | 0.95 | 0.8 |
| EpsilonDash | 1.0e-7 | 1.0e-7 | 1.0e-7 |

Note that the parameters are set in the order they are given, so you can set it
in a mode and then modify one parameter from this mode.
SDPA has three modes that give default value to all ten parameters.

The following table gives the default values for each parameter and mode.

| Parameter | `PARAMETER_DEFAULT` | `PARAMETER_UNSTABLE_BUT_FAST` | `PARAMETER_STABLE_BUT_SLOW` |
| ------------ | ------- | ------ | ------ |
| MaxIteration | 100 | 100 | 1000 |
| EpsilonStar | 1.0e-7 | 1.0e-7 | 1.0e-7 |
| LambdaStar | 1.0e+2 | 1.0e+2 | 1.0e+4 |
| OmegaStar | 2.0 | 2.0 | 2.0 |
| LowerBound | 1.0e+5 | 1.0e+5 | 1.0e+5 |
| UpperBound | 1.0e+5 | 1.0e+5 | 1.0e+5 |
| BetaStar | 0.1 | 0.01 | 0.1 |
| BetaBar | 0.2 | 0.02 | 0.3 |
| GammaStar | 0.9 | 0.95 | 0.8 |
| EpsilonDash | 1.0e-7 | 1.0e-7 | 1.0e-7 |

By default, we put SDPA in the `SDPA.PARAMETER_DEFAULT` mode.

Change the mode using the `"Mode"` option:
```julia
using JuMP, SDPA
model = Model(SDPA.Optimizer)
set_attribute(model, "Mode", SDPA.PARAMETER_STABLE_BUT_SLOW)
```

Note that the parameters are set in the order they are given, so you can set
a mode and then modify parameters from this mode.

```julia
using JuMP, SDPA
model = Model(SDPA.Optimizer)
set_attribute(model, "Mode", SDPA.PARAMETER_STABLE_BUT_SLOW)
set_attribute(model, "MaxIteration", 100)
```

The choice of parameter mode has a large impact on the performance and stability
of SDPA, and not necessarily in the way implied by the names of the modes; for
example, `PARAMETER_UNSTABLE_BUT_FAST` can be more stable than the other modes
for some problems. You should try each mode to see how it performs on your
specific problem. See [SDPA.jl#17](https://github.com/jump-dev/SDPA.jl/issues/17)
for more details.

2 comments on commit 78a903c

@odow
Copy link
Member Author

@odow odow commented on 78a903c Apr 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/81945

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.5.0 -m "<description of version>" 78a903cde3fdde6a3aed1e1eed93e7cb2ad0821d
git push origin v0.5.0

Please sign in to comment.