s1dlx / meh

Merging Execution Helper
MIT License
37 stars 10 forks source link

fix: Multiply difference sqrt once, not twice #20

Closed ljleb closed 1 year ago

ljleb commented 1 year ago

add fixes for multiply differences:

ljleb commented 1 year ago

Doing the multiplication with float precision instead of half precision fixes some details.

I suggest opening these two images in successive tabs to quickly switch back and forth between each other.

Half precision:

43456-58802588-magnificent tree in futuristic mechanical tools forest, bolts, screws, chainsaws, best quality, 8k, intrinsic value, masterpiece

Float precision:

43468-58802588-magnificent tree in futuristic mechanical tools forest, bolts, screws, chainsaws, best quality, 8k, intrinsic value, masterpiece

s1dlx commented 1 year ago

seems to preserve high frquency details 🤔

ljleb commented 1 year ago

I changed the way alpha works in the method again after realizing that $A = A^{1-\alpha} \times A^\alpha$. Using $A^{1-\alpha} \times B^\alpha$ we still get a model with a proper weight distribution.

ljleb commented 1 year ago

Here's a desmos graph to illustrate the response of the method https://www.desmos.com/calculator/st8dfkjkpq a: alpha w_A: any weight in diff A - C w_B: any corresponding weight in diff B - C

Using alpha = 0.5, if any weight is 0 in either A - C or B - C, then the result will be 0. The further both weights are from 0, the more it will look like a weighted average.