File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -77,23 +77,26 @@ def inv_multi_quadratic_biharmonic_spline(X, r=1):
7777 return result
7878
7979 @staticmethod
80- def thin_plate_spline (X , r = 1 ):
80+ def thin_plate_spline (X , r = 1 , k = 2 ):
8181 """
8282 It implements the following formula:
8383
8484 .. math::
8585 \\ varphi(\\ boldsymbol{x}) =
86- \\ left(\\ frac{\\ boldsymbol{x}}{r}\\ right)^2
86+ \\ left(\\ frac{\\ boldsymbol{x}}{r}\\ right)^k
8787 \\ ln\\ frac{\\ boldsymbol{x}}{r}
8888
89- :param numpy.ndarray X: the norm x in the formula above.
90- :param float r: the parameter r in the formula above.
89+ With k=2 the function is "radius free", that means independent of radius value.
9190
91+ :param numpy.ndarray X: the norm x in the formula above.
92+ :param float r: the parameter r in the formula above.
93+ :param float k: the parameter k in the formula above.
94+
9295 :return: result: the result of the formula above.
93- :rtype: float
96+ :rtype: float
9497 """
9598 arg = X / r
96- result = arg * arg
99+ result = np . power ( arg , k )
97100 result = np .where (arg > 0 , result * np .log (arg ), result )
98101 return result
99102
You can’t perform that action at this time.
0 commit comments