Changing a sigmoid curve to have an adjustable point of inflection

1.8k Views Asked by At

I am trying to an implement an adjustable Sigmoid curve such as in the YouTube video here. I found a potentially good candidate:

$$f_k(x) = \frac{\left(x-x\cdot k\right)}{k-\left|x\right|\cdot 2\cdot k+1}$$

But the inflection point is always $(0,0)$.

I need an S Curve that meets the Adjustable point of inflection of Sigmoid Curve.

Especially, you can see "Input Split" and "Output Split" in YouTube as parameters. I want to add and implement these parameter into above equation for $f_k$.

So please help me with and any ideas to modify the definition of $f_k$.

Thanks.

Update : I got some comment But I'm not sure about it. and I can't understand it Does anyone know how to an implement this? Currently I work here

2

There are 2 best solutions below

5
On BEST ANSWER

$% Predefined Typography \newcommand{\paren} [1]{\left({#1}\right)} \newcommand{\bparen}[1]{\bigg({#1}\bigg)} \newcommand{\brace} [1]{\left\{{#1}\right\}} \newcommand{\bbrace}[1]{\bigg\{{#1}\bigg\}} \newcommand{\floor} [1]{\left\lfloor{#1}\right\rfloor} \newcommand{\bfloor}[1]{\bigg\lfloor{#1}\bigg\rfloor} \newcommand{\mag} [1]{\left\lVert{#1}\right\rVert} \newcommand{\bmag} [1]{\bigg\Vert{#1}\bigg\Vert} \newcommand{\abs} [1]{\left\vert{#1}\right\vert} \newcommand{\babs} [1]{\bigg\vert{#1}\bigg\vert} % \newcommand{\labelt}[2]{\underbrace{#1}_{\text{#2}}} \newcommand{\label} [2]{\underbrace{#1}_{#2}} % \newcommand{\setcomp}[2]{\left\{{#1}~~\middle \vert~~ {#2}\right\}} \newcommand{\bsetcomp}[2]{\bigg\{{#1}~~\bigg \vert~~ {#2}\bigg\}} % \newcommand{\iint}[2]{\int {#1}~{\rm d}{#2}} \newcommand{\dint}[4]{\int_{#3}^{#4}{#1}~{\rm d}{#2}} \newcommand{\pred}[2]{\frac{\rm d}{{\rm d}{#2}}#1} \newcommand{\ind} [2]{\frac{{\rm d} {#1}}{{\rm d}{#2}}} % \newcommand{\ii}{{\rm i}} \newcommand{\ee}{{\rm e}} \newcommand{\exp}[1] { {\rm e}^{\large{#1}} } % \newcommand{\red} [1]{\color{red}{#1}} \newcommand{\blue} [1]{\color{blue}{#1}} \newcommand{\green}[1]{\color{green}{#1}} $First, I believe you have underspecified your function. It should be:

$$\begin{cases} f_k(x) = \frac{\left(x-x\cdot k\right)}{k-\abs{x}\cdot 2\cdot k+1} \\ -1 < x < 1 \\ 0 < k < 1 \\ \end{cases}$$

This makes the domain of your function $-1 < x < 1$ and the range $-1 < f_k < 1$ (interestingly, the range doesn't depend on $k$).

For my suggestion, first shift/scale the function to make the range and domain equal to $(0 .. 1)$:

$$\begin{cases} g_k(x) = \frac{f_k(2x - 1) + 1}{2}\\ 0 < x < 1 \\ 0 < k < 1 \\ \end{cases}$$

This puts the inflection point of $g_k$ at $(1/2, 1/2)$. You can now add 2 parameter $A$ and $B$ to shift the input and output:

$$\begin{cases} h_{k, A, B} (x) = g_k(\sqrt[A]{x})^B \\ 0 < x < 1 \\ 0 < k < 1 \\ \end{cases}$$

This puts the inflection point at $(1/2^A, 1/2^B)$. What's left is to verify that it is still a sigmoid:

  • (1) No poles in the range
  • (2) Upper limit and lower limit exist
  • (3) Always increasing
  • (4) Only 1 point of inflection (where second derivative changes signs)

(1) and (2) don't change with the given transform. (3) follows from composition of monotonic functions. (4) can be verified with a bit of calculus, but intuitively since $x^z$ doesn't have an inflection point in the range of $x>0$ then it shouldn't affect the existence of inflection points when used in functional composition.

2
On

The function you give is the second version of my sigmoid function, which works better than the one shown in the video.

To get the effect shown, I put three NTSF in series. The first takes values from -1 to 1 converted to the range 0 to 1. The output is converted back to the range -1 to 1, and the second NTSF applied. This output is then converted to the range 0 to 1, put through a third NTSF and converted back to -1 to 1.

That is $$\begin{align} v_1(x) &= {\rm NTSF}\left(\frac 12 x + \frac 12 ,~ k_1\right)\cdot 2+1 \\ v_2(x) &= {\rm NTSF}\bigg(v_1(x) ,~ k_2\bigg) \\ y &= {\rm NTSF}\left(\frac 12 v_2(x) + \frac 12 ,~ k_3\right)\cdot 2+1 \\ \end{align}$$

Hope that helps

Dino