Skip to content

Commit

Permalink
Update documentation for search
Browse files Browse the repository at this point in the history
The docstrings for the search module are now
added into the API documentation.

Author: ljvmiranda921
Email: ljvmiranda921@gmail.com
  • Loading branch information
ljvmiranda921 committed Sep 15, 2017
1 parent 39d8358 commit d9070e4
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 38 deletions.
3 changes: 2 additions & 1 deletion docs/api/pyswarms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ module.

.. toctree::

pyswarms.utils.functions
pyswarms.utils.functions
pyswarms.utils.search
37 changes: 37 additions & 0 deletions docs/api/pyswarms.utils.search.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
pyswarms.utils.search package
================================

.. automodule:: pyswarms.utils.search
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

pyswarms.utils.search.base_search module
-----------------------------------------

.. automodule:: pyswarms.utils.search.base_search
:members:
:undoc-members:
:show-inheritance:
:special-members:

pyswarms.utils.search.grid_search module
-----------------------------------------

.. automodule:: pyswarms.utils.search.grid_search
:members:
:undoc-members:
:show-inheritance:
:special-members:

pyswarms.utils.search.random_search module
-------------------------------------------

.. automodule:: pyswarms.utils.search.random_search
:members:
:undoc-members:
:show-inheritance:
:special-members:
4 changes: 1 addition & 3 deletions pyswarms/utils/search/base_search.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-
"""
Base class for hyperparameter optimization search functions.
"""
"""Base class for hyperparameter optimization search functions"""

# Import from __future__
from __future__ import with_statement
Expand Down
17 changes: 0 additions & 17 deletions pyswarms/utils/search/grid_search.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-

"""
Hyperparameter grid search.
Expand All @@ -13,22 +12,6 @@
default returns the minimum objective function score and hyperparameters that
yield the minimum score, yet maximum score can also be evaluated.
Parameters
----------
* c1 : float
cognitive parameter
* c2 : float
social parameter
* w : float
inertia parameter
* k : int
number of neighbors to be considered. Must be a
positive integer less than `n_particles`
* p: int {1,2}
the Minkowski p-norm to use. 1 is the
sum-of-absolute values (or L1 distance) while 2 is
the Euclidean (or L2) distance.
>>> options = {'c1': [1, 2, 3],
'c2': [1, 2, 3],
'w' : [2, 3, 5],
Expand Down
17 changes: 0 additions & 17 deletions pyswarms/utils/search/random_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,6 @@
returns the minimum objective function score and hyperparameters that yield
the minimum score, yet maximum score can also be evaluated.
Parameters
----------
* c1 : float
cognitive parameter
* c2 : float
social parameter
* w : float
inertia parameter
* k : int
number of neighbors to be considered. Must be a
positive integer less than `n_particles`
* p: int {1,2}
the Minkowski p-norm to use. 1 is the
sum-of-absolute values (or L1 distance) while 2 is
the Euclidean (or L2) distance.
>>> options = {'c1': [1, 5],
'c2': [6, 10],
Expand Down Expand Up @@ -60,8 +45,6 @@
# Import from package
from pyswarms.utils.search.base_search import SearchBase



class RandomSearch(SearchBase):
"""Search of optimal performance on selected objective function
over combinations of randomly selected hyperparameter values
Expand Down

0 comments on commit d9070e4

Please sign in to comment.