yura
yura

Reputation: 14655

How to implement fuzzy minimum function via fuzzy maximum

I know that I can represent fuzzy max via power function(i need it in neural network) i.e.

def max(p:Double)(a:Double,b:Double) = pow(pow(a,p) + pow(b,p) , 1/p) // assumption a >=0 and b >=0

It is become maximum when p -> infinity and sum when p = 1

Not sure how correctly implement fuzzy minimum.

Upvotes: 1

Views: 339

Answers (1)

burningbright
burningbright

Reputation: 152

If you are willing to replace "sum" with "harmonic sum" for the p=1 case, you can use

1/(pow(pow(a,-p) + pow(b,-p),1/p))

This converges to min(a,b) as p goes to infinity.

For p=1 it's 1/(1/a + 1/b), which is related to the harmonic mean but without the factor of 2. Just like in your original formula, a+b is related to the arithmetic mean but without the factor of 2.

However, note that both of these formulas (yours and mine) converge much more slowly to the limit as p goes to infinity, for cases where a and b are closer together.

Upvotes: 1

Related Questions