Skip to content

Commit

Permalink
Documentation updated to version 1.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwittek committed Nov 24, 2016
1 parent 0b505c2 commit 9313f97
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Since 1.7.1:
Version 1.7.2: 2016-11-24
- New: The coefficient of the Gaussian neighborhood function exp(-||x-y||^2/(2*(coeff*radius)^2)) is now exposed in all interfaces as a parameter.
- New: `get_bmu` function in the Python interface to get the best matching units given an activation map.
- Changed: Updated PCA initialization in the Python interface to work with `sk-learn` 0.18 onwards.
Expand Down
15 changes: 9 additions & 6 deletions src/Python/doc/source/example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ First, we import the necessary modules:
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import somoclu
%matplotlib inline
%matplotlib inline
Then we generate and plot some random data in three categories:

Expand Down Expand Up @@ -56,7 +56,7 @@ that qualifies as an emergent self-organizing map for this data:
.. code:: python
n_rows, n_columns = 100, 160
som = somoclu.Somoclu(n_columns, n_rows, data=data)
som = somoclu.Somoclu(n_columns, n_rows, data=data, compactsupport=False)
%time som.train()
Expand Down Expand Up @@ -119,7 +119,7 @@ lower right corner:

.. code:: python
som.view_umatrix(bestmatches=True, bestmatchcolors=colors, labels=labels,
som.view_umatrix(bestmatches=True, bestmatchcolors=colors, labels=labels,
zoom=((50, n_rows), (100, n_columns)))
Expand All @@ -143,7 +143,8 @@ type as follows:

.. code:: python
som = somoclu.Somoclu(n_columns, n_rows, data=data, maptype="toroid")
som = somoclu.Somoclu(n_columns, n_rows, data=data, maptype="toroid",
compactsupport=False)
som.train()
som.view_umatrix(bestmatches=True, bestmatchcolors=colors)
Expand All @@ -165,7 +166,8 @@ neurons are also implemented:

.. code:: python
som = somoclu.Somoclu(n_columns, n_rows, data=data, gridtype="hexagonal")
som = somoclu.Somoclu(n_columns, n_rows, data=data, gridtype="hexagonal",
compactsupport=False)
som.train()
som.view_umatrix(bestmatches=True, bestmatchcolors=colors)
Expand Down Expand Up @@ -195,7 +197,8 @@ this, we need to pass an optional argument to the constructor:

.. code:: python
som = somoclu.Somoclu(n_columns, n_rows, data=data, maptype="toroid", initialization="pca")
som = somoclu.Somoclu(n_columns, n_rows, data=data, maptype="toroid",
compactsupport=False, initialization="pca")
som.train()
som.view_umatrix(bestmatches=True, bestmatchcolors=colors)
Expand Down
19 changes: 16 additions & 3 deletions src/Python/doc/source/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Function Reference
******************

.. py:class:: Somoclu(n_columns, n_rows, data=None, initialcodebook=None, kerneltype=0, maptype='planar', gridtype='rectangular', compactsupport=False, neighborhood='gaussian', initialization=None)
.. py:class:: Somoclu(n_columns, n_rows, data=None, initialcodebook=None, kerneltype=0, maptype='planar', gridtype='rectangular', compactsupport=False, neighborhood='gaussian', std_coeff=0.5, initialization=None)
Class for training and visualizing a self-organizing map.

Expand Down Expand Up @@ -77,6 +77,19 @@ Function Reference
:returns: The the dot product of the codebook and the data.
:rtype: 2D numpy.array


.. py:method:: Somoclu.get_bmus(activation_map)
Return Best Matching Unit indexes of the activation map.

:param activation_map: Activation map computed with self.get_surface_state()
:type activation_map: 2D numpy.array

:returns: The bmus indexes corresponding to this activation map
(same as self.bmus for the training samples).
:rtype: 2D numpy.array


.. py:method:: Somoclu.load_bmus(filename)
Load the best matching units from a file to the Somoclu object.
Expand Down Expand Up @@ -118,9 +131,9 @@ Function Reference
* "linear": Linear interpolation (default)
* "exponential": Exponential decay
:param scale0: The initial learning scale. Default value: 0.1.
:type scale0: int.
:type scale0: float.
:param scaleN: The learning scale in the final epoch. Default: 0.01.
:type scaleN: int.
:type scaleN: float.
:param scalecooling: The cooling strategy between scale0 and scaleN:

* "linear": Linear interpolation (default)
Expand Down

0 comments on commit 9313f97

Please sign in to comment.