Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete encoder docstrings #3579

Merged
merged 15 commits into from
May 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,21 @@ nupic
│   ├── stream_reader.py [TODO]
│   └── utils.py [TODO]
├── encoders
│   ├── adaptivescalar.py [TODO]
│   ├── base.py [TODO]
│   ├── category.py [TODO]
│   ├── coordinate.py [TODO]
│   ├── date.py [TODO]
│   ├── delta.py [TODO]
│   ├── geospatial_coordinate.py [TODO]
│   ├── logenc.py [TODO]
│   ├── multi.py [TODO]
│   ├── pass_through_encoder.py [TODO]
│   ├── random_distributed_scalar.py [TODO]
│   ├── scalar.py [TODO]
│   ├── scalarspace.py [TODO]
│   ├── sdrcategory.py [TODO]
│   ├── sparse_pass_through_encoder.py [TODO]
│   └── utils.py [TODO]
│   ├── adaptivescalar.py [OK]
│   ├── base.py [OK]
│   ├── category.py [OK]
│   ├── coordinate.py [OK]
│   ├── date.py [OK]
│   ├── delta.py [OK]
│   ├── geospatial_coordinate.py [OK]
│   ├── logenc.py [OK]
│   ├── multi.py [OK]
│   ├── pass_through_encoder.py [OK]
│   ├── random_distributed_scalar.py [OK]
│   ├── scalar.py [OK]
│   ├── scalarspace.py [OK]
│   ├── sdrcategory.py [OK]
│   └── sparse_pass_through_encoder.py [OK]
├── frameworks
│   ├── opf
│   │   ├── htm_prediction_model.py [TODO]
Expand Down
71 changes: 52 additions & 19 deletions docs/source/api/algorithms/encoders.rst
Original file line number Diff line number Diff line change
@@ -1,50 +1,83 @@
Encoders
--------

Encoder
^^^^^^^
.. automodule:: nupic.encoders.base

Base Encoder
^^^^^^^^^^^^

.. autoclass:: nupic.encoders.base.Encoder
:members:

Scalar Encoder
Encoder Result
^^^^^^^^^^^^^^

.. autoclass:: nupic.encoders.base.EncoderResult

Category Encoders
^^^^^^^^^^^^^^^^^

.. autoclass:: nupic.encoders.category.CategoryEncoder
:show-inheritance:

.. autoclass:: nupic.encoders.sdrcategory.SDRCategoryEncoder
:show-inheritance:

Scalar Encoders
^^^^^^^^^^^^^^^

.. autoclass:: nupic.encoders.scalar.ScalarEncoder
:members:
:show-inheritance:

Random Distributed Scalar Encoder
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autoclass:: nupic.encoders.adaptivescalar.AdaptiveScalarEncoder
:show-inheritance:

.. autoclass:: nupic.encoders.random_distributed_scalar.RandomDistributedScalarEncoder
:members:
:show-inheritance:
:members: mapBucketIndexToNonZeroBits
:show-inheritance:

.. autoclass:: nupic.encoders.scalarspace.ScalarSpaceEncoder
:show-inheritance:

.. autoclass:: nupic.encoders.delta.DeltaEncoder
:show-inheritance:

.. autoclass:: nupic.encoders.logenc.LogEncoder
:show-inheritance:


DateEncoder
^^^^^^^^^^^

.. autoclass:: nupic.encoders.date.DateEncoder
:members:
:members: getScalars
:show-inheritance:

CoordinateEncoder
^^^^^^^^^^^^^^^^^
Coordinate Encoders
^^^^^^^^^^^^^^^^^^^

.. autoclass:: nupic.encoders.coordinate.CoordinateEncoder
:members:

GeospatialCoordinateEncoder
^^^^^^^^^^^^^^^^^^^^^^^^^^^
:show-inheritance:

.. autoclass:: nupic.encoders.geospatial_coordinate.GeospatialCoordinateEncoder
:members:


:members: coordinateForPosition, radiusForSpeed
:show-inheritance:

MultiEncoder
^^^^^^^^^^^^

.. autoclass:: nupic.encoders.multi.MultiEncoder
:members:
:members: addEncoder, addMultipleEncoders
:show-inheritance:

Pass Through Encoders
^^^^^^^^^^^^^^^^^^^^^

Used to pass raw SDRs through to the algorithms when data is already encoded.

.. autoclass:: nupic.encoders.pass_through_encoder.PassThroughEncoder
:members: closenessScores
:show-inheritance:

.. autoclass:: nupic.encoders.sparse_pass_through_encoder.SparsePassThroughEncoder
:show-inheritance:
8 changes: 4 additions & 4 deletions docs/source/api/data/field-meta.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Field Meta
^^^^^^^^^^

.. automodule:: nupic.data.fieldmeta
.. automodule:: nupic.data.field_meta

.. autoclass:: nupic.data.fieldmeta.FieldMetaInfo
.. autoclass:: nupic.data.field_meta.FieldMetaInfo
:members:

.. autoclass:: nupic.data.fieldmeta.FieldMetaType
.. autoclass:: nupic.data.field_meta.FieldMetaType
:members:

.. autoclass:: nupic.data.fieldmeta.FieldMetaSpecial
.. autoclass:: nupic.data.field_meta.FieldMetaSpecial
:members:
8 changes: 5 additions & 3 deletions src/nupic/encoders/adaptivescalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ class AdaptiveScalarEncoder(ScalarEncoder):
**Note:** the sliding window may record duplicates of the values in the dataset,
and therefore does not reflect the statistical distribution of the input data
and may not be used to calculate the median, mean etc.

For params, see :class:`~.nupic.encoders.scalar.ScalarEncoder`.

:raises: Exception if input is periodic.

"""


def __init__(self, w, minval=None, maxval=None, periodic=False, n=0, radius=0,
resolution=0, name=None, verbosity=0, clipInput=True, forced=False):
"""
[overrides nupic.encoders.scalar.ScalarEncoder.__init__]
"""
self._learningEnabled = True
if periodic:
#Adaptive scalar encoders take non-periodic inputs only
Expand Down
Loading