How to find the function parameters with some constraint?

41 Views Asked by At

In the context of neural networks, I am using a function to increase the difference between "good" accuracies and "bad" accuracies, i.e, for example all accuracies below 0.8 are considered bad and all accuracies above, good.

The function looks as follow:

$$ new\_x(x) = \frac{1}{1+e^{-Ax +B}} $$ Where $x$ is the accuracy, here is the graph, with A=1 and B=0

My question is the following: how do I find the values of A and B such the function returns high values (close to 1) after $x=0.8$ and very low before $x=0.8$ (close to $0$) ?

I have tried to find it out manually, but I would like to automate the process. I guess the solution involves constraints solving, that is why I tagged it this ways (but feel free to suggest another tag).

Thanks a lot!

1

There are 1 best solutions below

0
On BEST ANSWER

Let $f(x)= \frac{1}{1+e^{-Ax +B}}$. It can be easily noticed that the range of $f$ is $(0,1)$ and for $A>0$, $f$ is strictly increasing and for $A<0, f$ is strictly decreasing.

Now, you want $f(x)$ close to $0$ when $x<0.8$ and $f(x)$ close to $1$ when $x>0.8$. That means three things: first, $A$ should be positive. Second, slope of the $f(x)$ curve should be very large at $x=0.8$. Third, the point where the graph changes its concavity from concave upwards to concave downwards should be $0.8$

You need to find $\{A>0,B\}$ such that $f'(x)_{\text{ at }x=0.8}$ is large and $f''(x)_{\text{at }x=0.8}=0$