Commit 6cfd2ae1 authored by vfdev's avatar vfdev Committed by Francisco Massa
Browse files

Fix transforms.Pad and transforms.LinearTransformation doc strings (#511)

parent 55d73951
...@@ -227,17 +227,24 @@ class Pad(object): ...@@ -227,17 +227,24 @@ class Pad(object):
on left/right and top/bottom respectively. If a tuple of length 4 is provided on left/right and top/bottom respectively. If a tuple of length 4 is provided
this is the padding for the left, top, right and bottom borders this is the padding for the left, top, right and bottom borders
respectively. respectively.
fill: Pixel fill value for constant fill. Default is 0. If a tuple of fill (int or tuple): Pixel fill value for constant fill. Default is 0. If a tuple of
length 3, it is used to fill R, G, B channels respectively. length 3, it is used to fill R, G, B channels respectively.
This value is only used when the padding_mode is constant This value is only used when the padding_mode is constant
padding_mode: Type of padding. Should be: constant, edge, reflect or symmetric. Default is constant. padding_mode (str): Type of padding. Should be: constant, edge, reflect or symmetric.
constant: pads with a constant value, this value is specified with fill Default is constant.
edge: pads with the last value at the edge of the image
reflect: pads with reflection of image (without repeating the last value on the edge) - constant: pads with a constant value, this value is specified with fill
padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
- edge: pads with the last value at the edge of the image
- reflect: pads with reflection of image without repeating the last value on the edge
For example, padding [1, 2, 3, 4] with 2 elements on both sides in reflect mode
will result in [3, 2, 1, 2, 3, 4, 3, 2] will result in [3, 2, 1, 2, 3, 4, 3, 2]
symmetric: pads with reflection of image (repeating the last value on the edge)
padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode - symmetric: pads with reflection of image repeating the last value on the edge
For example, padding [1, 2, 3, 4] with 2 elements on both sides in symmetric mode
will result in [2, 1, 1, 2, 3, 4, 4, 3] will result in [2, 1, 1, 2, 3, 4, 4, 3]
""" """
...@@ -655,7 +662,7 @@ class LinearTransformation(object): ...@@ -655,7 +662,7 @@ class LinearTransformation(object):
original shape. original shape.
Applications: Applications:
- whitening: zero-center the data, compute the data covariance matrix - whitening: zero-center the data, compute the data covariance matrix
[D x D] with np.dot(X.T, X), perform SVD on this matrix and [D x D] with np.dot(X.T, X), perform SVD on this matrix and
pass it as transformation_matrix. pass it as transformation_matrix.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment