I'm designing a loss function for an optimization problem.
My requirements for this function are:
- If only x is small, the function should be small
- If only y is small, the function should be small
- If both x and y are large, the function should be large
- If both x and y are small, the function should be large
In my mind this function looks something like this:
Note how the function minima avoids the origin to comply with the 4th requirement. The x, and y values will always be positive, so I only care about the first quadrant.
The best I could come up with is $$f(x, y) = \sqrt{(\frac{1}{0.05*x})-y)^6}$$ which results in a function that looks like this
https://i.imgur.com/4mc8rIK.png
https://i.imgur.com/2daiCHX.png
The problem is that the minima gets very "thin" along the y-axis compared to the x-axis.
I'm aware that “large” and “small” are very vague terms. I only need the structure of the function, I can tune its size later myself.
What function can represent what I'm looking for?
Assuming, you want domain $x,y>0$, by taking logs, you can reword your question as
From this it's clear that $f=xy$ should work. After taking exponents: $$ f = e^{\log x \log y} $$