Skip to content

Pass over the documentation.#55

Merged
icouckuy merged 7 commits intomasterfrom
doc_acquisition
Aug 7, 2017
Merged

Pass over the documentation.#55
icouckuy merged 7 commits intomasterfrom
doc_acquisition

Conversation

@icouckuy
Copy link
Copy Markdown
Contributor

@icouckuy icouckuy commented Aug 3, 2017

I did another pass over the documentation of the acquisition function fixing typo's, added some missing doc strings, etc. Also fixed #51

I have some more question/comments which I will add as comments in the change list.

"""
:param models: list of GPflow models representing our beliefs about the problem
:param optimize_restarts: number of optimization restarts to use when training the models
"""
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What is the python way of documenting overrided subclass functions such as the constructor? I think sphinx will actually only display the doc string of the overrided method?

Here optimize_restarts is not visible from the overrided class anyways

On the other hand, many overrided functions and parameters (such as models here, or build_acquisition) do not required specific documentation (do we copy the doc string for each overrided method, or document only the base/abstract method).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

by default all special members (getitem, eq etc) are excluded. I added these special-members directive but its not doing anything. I often see constructor documentation put in place of class documentation. If you google it, there are some ways to enable but be a bit careful and check the output of the sphinx building very well. I noticed changing things in the conf.py can have significant side effects.


It is called after initialization and set_data(), and before optimizing the acquisition function itself.
It is called automatically after initialization and each time set_data() is called.
When using the high-level :class:`..BayesianOptimizer` class calling set_data() is taken care of.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I hope I got this right. The old explanation did not seem quite right to me. The part about the high-level class could be removed as that will be explained in BayesianOptimizer itself.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

seems ok

Comment thread GPflowOpt/acquisition/acquisition.py Outdated

:param domain: :class:`.Domain` object, the input transform of the data scalers is configured as a transform
from domain to the unit cube with the same dimensionality.
from domain to the unit cube with the same dimensionality.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

seems multiline param explanation should be properly indented for sphinx to display it correctly. Perhaps using the python line continuation \ works too

"""
Method triggered after calling set_data().

Override for pre-calculation of quantities used later in
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is explained as an override, for what reason would you want to call setup yourself? If not, we might make it private (deja vu, did we have that discussion before?)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hmm, this could indeed be turned into private as it is now called from set_data. But I don't think it is very nice to present an interface for users to implement where it is a common practice to override a protected method.

Comment thread GPflowOpt/acquisition/acquisition.py Outdated
"""
AutoFlow method to compute the acquisition scores for candidates, also returns the gradients.

:return: (ndarray of acquisition scores(N x 1), ndarray of the gradients of the scores (N*D))
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is still on my list. I see I made some typos

@codecov-io
Copy link
Copy Markdown

codecov-io commented Aug 3, 2017

Codecov Report

Merging #55 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #55   +/-   ##
=======================================
  Coverage   99.73%   99.73%           
=======================================
  Files          14       14           
  Lines         757      757           
=======================================
  Hits          755      755           
  Misses          2        2
Impacted Files Coverage Δ
GPflowOpt/acquisition/poi.py 100% <ø> (ø) ⬆️
GPflowOpt/transforms.py 100% <ø> (ø) ⬆️
GPflowOpt/optim.py 100% <ø> (ø) ⬆️
GPflowOpt/acquisition/pof.py 100% <ø> (ø) ⬆️
GPflowOpt/bo.py 98.46% <ø> (ø) ⬆️
GPflowOpt/acquisition/ei.py 100% <ø> (ø) ⬆️
GPflowOpt/design.py 100% <ø> (ø) ⬆️
GPflowOpt/acquisition/lcb.py 100% <ø> (ø) ⬆️
GPflowOpt/domain.py 98.87% <ø> (ø) ⬆️
GPflowOpt/scaling.py 100% <ø> (ø) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1273304...4b43022. Read the comment docs.

@icouckuy icouckuy changed the title Pass over the acquisition documentation. Pass over the documentation. Aug 4, 2017
- Added small getting started guide and first steps notebook
- restructured the API menu and added Bayesian optimizer + designs pages
- Went over a lot of doc strings, tried to uniformize the shape information + notation of the matrices
- Added sectio headings for all notebooks (they show up as subsections in the menu)
- Fixed all sphinx warnings
@icouckuy icouckuy merged commit 2db20b7 into master Aug 7, 2017
@icouckuy icouckuy deleted the doc_acquisition branch August 7, 2017 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Citation for probability of feasibility

3 participants