Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MagiFeeney authored Jul 13, 2022
1 parent 664b52f commit c22d7a5
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,35 @@ $ cd MagiOPT
## How to use
- Unconstrained
```python
import MagiOPT as optim
import MagiOPT as optim

def func(x):
...
def func(x):
...

optimizer = optim.SD(func) # Steepest Descent
x = optimizer.step(x0) # On-the-fly
optimizer.plot() # Visualize
optimizer = optim.SD(func) # Steepest Descent
x = optimizer.step(x0) # On-the-fly
optimizer.plot() # Visualize
```

- Constrained
```python
import MagiOPT as optim
import MagiOPT as optim

def object(x):
...
def constr1(x):
...
def constr2(x):
...
def object(x):
...
def constr1(x):
...
def constr2(x):
...
...

optimizer = optim.Penalty(object,
sigma,
(constr1, '<='),
(constr2, '>='),
plot=True)) # Penalty methoed
optimizer.BFGS() # Inner optimizer
x = optimizer.step(x0) # On-the-fly
optimizer = optim.Penalty(object,
sigma,
(constr1, '<='),
(constr2, '>='),
plot=True)) # Penalty methoed
optimizer.BFGS() # Inner optimizer
x = optimizer.step(x0) # On-the-fly
```
## Supported Optimizers
| Unconstrained | Constrained |
Expand Down

0 comments on commit c22d7a5

Please sign in to comment.