Looking for a function with certain limits and derivatives

24 Views Asked by At

I'm looking for a differntiable function f (I want to use it as a loss function for a machine learning task) where:

\begin{aligned} \lim_{x\to1^{-}} f(x) &= -\inf &&& f^{\prime}(0^{+}) &= \inf\\ \lim_{x\to0^{+}} f(x) &= 0 &&& f^{\prime}(1^{-}) &= -\inf \end{aligned}

How can I find such function?

enter image description here

1

There are 1 best solutions below

0
On

On first random guess, one function that works is $$ f(x)=-\frac{\sqrt x}{1-x}. $$ One can delay the "falling to $-\infty$" by taking powers of $x$:$$ g(x)=-\frac{k\sqrt x}{1-x^m}. $$ The larger the $m$, the later the function goes pitching down; and the larger the $k$, the lower the change in convexity will be.