add sigmoid function to basic models
This commit is contained in:
parent
f33643955b
commit
66b56c9be6
@ -203,6 +203,31 @@ class Sinc:
|
|||||||
return c * np.sinc(((x-x0)/w)/np.pi)
|
return c * np.sinc(((x-x0)/w)/np.pi)
|
||||||
|
|
||||||
|
|
||||||
|
class Sigmoid:
|
||||||
|
type = 'Basic'
|
||||||
|
name = 'Sigmoid'
|
||||||
|
equation = 'C / [1 + exp(-a * (x - x_{0})] + y_{0}'
|
||||||
|
params = ['C', 'a', 'x_{0}', 'y_{0}']
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def func(x, c, a, x0, y0):
|
||||||
|
"""
|
||||||
|
Sigmoid function
|
||||||
|
|
||||||
|
.. math::
|
||||||
|
y = C / [1 + exp(-a * (x - x_0))] + y_0
|
||||||
|
|
||||||
|
Args:
|
||||||
|
x (array_like): Input values
|
||||||
|
c (float): Prefactor
|
||||||
|
a (float): Steepness of the sigmoid
|
||||||
|
x0 (float): x position of the sigmoid's midpoint
|
||||||
|
y0 (float): y position of the sigmoid's midpoint
|
||||||
|
|
||||||
|
"""
|
||||||
|
return c / (1 + np.exp(-a * (x - x0))) + y0
|
||||||
|
|
||||||
|
|
||||||
class Sine:
|
class Sine:
|
||||||
"""
|
"""
|
||||||
Wavy sine function
|
Wavy sine function
|
||||||
|
Loading…
x
Reference in New Issue
Block a user