-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Clean up (and rename) examples code and output files
- Loading branch information
Showing
8 changed files
with
73 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
12 changes: 6 additions & 6 deletions
12
docs/source/examples/hoburgabbeel_ex6_1.py → docs/source/examples/ex1.py
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
File renamed without changes.
11 changes: 6 additions & 5 deletions
11
docs/source/examples/hoburgabbeel_ex6_3.py → docs/source/examples/ex2.py
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
File renamed without changes.
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 |
---|---|---|
|
@@ -17,7 +17,7 @@ Table of Contents | |
|
||
gpfit101 | ||
installation | ||
examples | ||
tutorial | ||
reference | ||
citinggpfit | ||
acknowledgements |
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,56 @@ | ||
Tutorial | ||
******** | ||
|
||
Given log-transformed data `x` and `y`, we can create a fit with `K` terms with | ||
a single command: | ||
|
||
.. code:: | ||
f = ImplicitSoftmaxAffine(x, y, K) | ||
We can then plot it: | ||
|
||
.. code:: | ||
f, ax = f.plot() # for 1D fits | ||
f, ax = f.plot_slices() # for 2D fits | ||
f, ax = f.plot_surface() # for 2D fits | ||
and save it: | ||
|
||
.. code:: | ||
f.savetxt(filename="fit.txt") # saves string of fit to text file | ||
f.save(filename="fit.pkl") # saves fit object to pickle file | ||
We can even generate a GPkit constraint set: | ||
|
||
.. code:: | ||
fcs = f.constraint_set() | ||
Examples | ||
======== | ||
Both examples come from Section 6 of this `paper | ||
<https://dspace.mit.edu/bitstream/handle/1721.1/105753/11081_2016_9332_ReferencePDF.pdf?sequence=2&isAllowed=y>`_. | ||
|
||
Example 1 | ||
--------- | ||
|
||
Fit convex portion of :math:`w = \frac{u^2 + 3}{(u+1)^2}` on :math:`1 \leq u \leq 3`. | ||
|
||
.. literalinclude:: examples/ex1.py | ||
|
||
Output: | ||
|
||
.. literalinclude:: examples/ex1_output.txt | ||
|
||
Example 2 | ||
--------- | ||
|
||
.. literalinclude:: examples/ex2.py | ||
|
||
Output: | ||
|
||
.. literalinclude:: examples/ex2_output.txt |
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