Skip to content

Commit 80958bc

Browse files
authored
Merge pull request #100 from PerformanceEstimation/fix/improvements_in_quickstart
Improvements of quickstart
2 parents d87b265 + 45b6efa commit 80958bc

File tree

1 file changed

+46
-18
lines changed

1 file changed

+46
-18
lines changed

docs/source/quickstart.rst

Lines changed: 46 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ A gentle introduction to performance estimation problems is provided in this
77
<https://francisbach.com/computer-aided-analyses/>`_.
88

99
The PEPit implementation is in line with the framework as exposed in [3,4]
10-
and follow-up works (for which proper references are provided in the example files).
10+
and follow-up works (for which proper references are provided in the `example files
11+
<https://pepit.readthedocs.io/en/latest/examples.html#>`_).
1112
A gentle introduction to the toolbox is provided in [1].
1213

1314
When to use PEPit?
@@ -27,7 +28,7 @@ How tu use PEPit?
2728
Installation
2829
^^^^^^^^^^^^
2930

30-
PEPit is available on pypi, hence can be installed very simply by running
31+
PEPit is available on PyPI, hence can be installed very simply by running the command line:
3132

3233
``pip install pepit``
3334

@@ -47,7 +48,8 @@ Basic usage: getting worst-case guarantees
4748
The main object is called a **PEP**.
4849
It stores the problem you will describe to **PEPit**.
4950

50-
First create a **PEP** object.
51+
First create a `**PEP**
52+
<https://pepit.readthedocs.io/en/latest/api/main_modules.html#PEPit.PEP>`_ object.
5153

5254
.. code-block::
5355
@@ -59,20 +61,23 @@ First create a **PEP** object.
5961
problem = PEP()
6062
6163
62-
From now, you can declare functions thanks to the `declare_function` method.
64+
From now, you can declare `functions
65+
<https://pepit.readthedocs.io/en/latest/api/functions_and_operators.html>`_ thanks to the `declare_function
66+
<https://pepit.readthedocs.io/en/latest/api/main_modules.html#PEPit.PEP.declare_function>`_ method.
6367

6468
.. code-block::
6569
6670
from PEPit.functions import SmoothConvexFunction
6771
6872
.. code-block::
6973
70-
func = problem.declare_function(SmoothConvexFunction, L=L)
74+
func = problem.declare_function(SmoothConvexFunction, L=1)
7175
7276
.. warning::
7377
To enforce the same subgradient to be returned each time one is required,
74-
we introduced the attribute `reuse_gradient` in the `Function` class.
75-
Some classes of functions contain only differentiable functions (e.g. smooth convex function).
78+
we introduced the attribute `reuse_gradient` in the `Function
79+
<https://pepit.readthedocs.io/en/0.3.2/api/main_modules.html#function>`_ class.
80+
Some classes of functions contain only differentiable functions (e.g. smooth convex functions).
7681
In those, the `reuse_gradient` attribute is set to True by default.
7782

7883
When the same subgradient is used several times in the same code and when it is difficult to
@@ -84,35 +89,42 @@ From now, you can declare functions thanks to the `declare_function` method.
8489
`no Lips in Bregman divergence
8590
<https://pepit.readthedocs.io/en/latest/examples/b.html#no-lips-in-bregman-divergence>`_.
8691

87-
You can also define a new point with
92+
You can also define a new `point
93+
<https://pepit.readthedocs.io/en/0.3.2/api/main_modules.html#point>`_ with
8894

8995
.. code-block::
9096
9197
x0 = problem.set_initial_point()
9298
9399
94-
and give a name to the value of `func` on `x0`
100+
and store the value of `func` on `x0`
95101

96102
.. code-block::
97103
98104
f0 = func(x0)
99105
106+
or
107+
108+
.. code-block::
109+
110+
f0 = func.value(x0)
111+
100112
101113
as well as the (sub)gradient of `func` on `x0`
102114

103115
.. code-block::
104116
105117
g0 = func.gradient(x0)
106118
107-
108119
or
109120

110121
.. code-block::
111122
112123
g0 = func.subgradient(x0)
113124
114125
115-
There is a more compact way to do it using the `oracle` method.
126+
There is a more compact way to do it using the `oracle
127+
<https://pepit.readthedocs.io/en/0.3.2/api/main_modules.html#PEPit.Function.oracle>`_ method.
116128

117129
.. code-block::
118130
@@ -124,6 +136,19 @@ You can declare a stationary point of `func`, defined as a point which gradient
124136
125137
xs = func.stationary_point()
126138
139+
Then you can define the associated function value using:
140+
141+
.. code-block::
142+
143+
fs = func(xs)
144+
145+
Alternatively, you can use an option of the `stationary_point
146+
<https://pepit.readthedocs.io/en/0.3.2/api/main_modules.html#PEPit.Function.stationary_point>`_ method to get the stationary point and properties of func on the latter.
147+
148+
.. code-block::
149+
150+
xs, gs, fs = func.stationary_point(return_gradient_and_function_value=True)
151+
127152
128153
You can combine points and gradients naturally
129154

@@ -165,7 +190,8 @@ Finally, you can ask PEPit to solve the system for you and return the worst-case
165190
Derive proofs and adversarial objectives
166191
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
167192

168-
When one calls the `solve` method,
193+
When one calls the `solve
194+
<https://pepit.readthedocs.io/en/0.3.2/api/main_modules.html#PEPit.PEP.solve>`_ method,
169195
**PEPit** does much more that just finding the worst-case value.
170196

171197
In particular, it stores possible values of each points, gradients and function values that achieve this worst-case guarantee,
@@ -198,7 +224,7 @@ You can also get the dual variables values of constraints at optimum,
198224
which essentially allows you to write the proof of the worst-case guarantee you just obtained.
199225

200226
Let's consider again the previous example, but this time,
201-
let's give a name to a constraint before using it.
227+
let's store a constraint before using it.
202228

203229
.. code-block::
204230
@@ -215,7 +241,8 @@ Naming PEPit objects
215241
~~~~~~~~~~~~~~~~~~~~
216242

217243
In order to ease the proof reconstruction, PEPit now allows to associate names to the created objects.
218-
This is particularly useful on constraints in order to associate the found dual values to some recognisable constraints.
244+
This is particularly useful on `constraints
245+
<https://pepit.readthedocs.io/en/0.3.2/api/main_modules.html#constraint>`_ in order to associate the found dual values to some recognisable constraints.
219246

220247
As an example, if a user creates several constraints in a row as
221248

@@ -226,7 +253,7 @@ As an example, if a user creates several constraints in a row as
226253
constraint.set_name(name)
227254
problem.add_constraint(constraint)
228255
229-
the latter can easily list their names in front of their dual values as
256+
the latter can easily list their names in front of their dual values with
230257

231258
.. code-block::
232259
@@ -236,7 +263,8 @@ the latter can easily list their names in front of their dual values as
236263
Functions generally contain several "interpolation constraints".
237264
If a user sets a name to a function as well as to all the points the oracle has been called on,
238265
then, its interpolation constraints will be attributed a name accordingly.
239-
Then, using the method `get_class_constraints_duals`,
266+
Then, using the method `get_class_constraints_duals
267+
<https://pepit.readthedocs.io/en/0.3.2/api/main_modules.html#PEPit.Function.get_class_constraints_duals>`_,
240268
the user has access to the tables of dual values related to its interpolation constraints.
241269

242270
Output pdf
@@ -258,7 +286,7 @@ You can use the trace heuristic by specifying
258286
259287
problem.solve(dimension_reduction_heuristic="trace")
260288
261-
You can use the n iteration of the log det heuristic by specifying "logdetn". For example, for
289+
You can use n iterations of the log det heuristic by specifying "logdet{n}". For example, for
262290
using 5 iterations of the logdet heuristic:
263291

264292
.. code-block::
@@ -271,7 +299,7 @@ Finding Lyapunov
271299

272300
In a later release, we will provide tools to help finding good Lyapunov functions to study a given method.
273301

274-
This tool will be based on the very recent work [7].
302+
This tool will be based on the method described in [7].
275303

276304
References
277305
----------

0 commit comments

Comments
 (0)