Skip to content

Commit bfbbacb

Browse files
committed
NNGraph: clean and doc (PR #21)
1 parent 441341f commit bfbbacb

11 files changed

+359
-351
lines changed

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The documentation is available on
3737
`Read the Docs <https://pygsp.readthedocs.io>`_
3838
and development takes place on
3939
`GitHub <https://github.com/epfl-lts2/pygsp>`_.
40-
(A (mostly unmaintained) `Matlab version <https://epfl-lts2.github.io/gspbox-html>`_ exists.)
40+
A (mostly unmaintained) `Matlab version <https://epfl-lts2.github.io/gspbox-html>`_ exists.
4141

4242
The PyGSP facilitates a wide variety of operations on graphs, like computing
4343
their Fourier basis, filtering or interpolating signals, plotting graphs,

pygsp/graphs/nngraphs/bunny.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, **kwargs):
3434
'distance': 8,
3535
}
3636

37-
super(Bunny, self).__init__(Xin=data['bunny'],
38-
epsilon=0.02, NNtype='radius',
37+
super(Bunny, self).__init__(data['bunny'],
3938
center=False, rescale=False,
39+
kind='radius', radius=0.02,
4040
plotting=plotting, **kwargs)

pygsp/graphs/nngraphs/cube.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def __init__(self,
8989
'distance': 9,
9090
}
9191

92-
super(Cube, self).__init__(Xin=pts, k=10,
92+
super(Cube, self).__init__(pts, k=10,
9393
center=False, rescale=False,
9494
plotting=plotting, **kwargs)
9595

pygsp/graphs/nngraphs/imgpatches.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class ImgPatches(NNGraph):
1010
1111
Extract a feature vector in the form of a patch for every pixel of an
1212
image, then construct a nearest-neighbor graph between these feature
13-
vectors. The feature matrix, i.e. the patches, can be found in :attr:`Xin`.
13+
vectors. The feature matrix, i.e., the patches, can be found in
14+
:attr:`features`.
1415
1516
Parameters
1617
----------
@@ -35,9 +36,10 @@ class ImgPatches(NNGraph):
3536
>>> from skimage import data, img_as_float
3637
>>> img = img_as_float(data.camera()[::64, ::64])
3738
>>> G = graphs.ImgPatches(img, patch_shape=(3, 3))
38-
>>> print('{} nodes ({} x {} pixels)'.format(G.Xin.shape[0], *img.shape))
39+
>>> N, d = G.features.shape
40+
>>> print('{} nodes ({} x {} pixels)'.format(N, *img.shape))
3941
64 nodes (8 x 8 pixels)
40-
>>> print('{} features per node'.format(G.Xin.shape[1]))
42+
>>> print('{} features per node'.format(d))
4143
9 features per node
4244
>>> G.set_coordinates(kind='spring', seed=42)
4345
>>> fig, axes = plt.subplots(1, 2)

0 commit comments

Comments
 (0)