|
@@ -3,10 +3,9 @@ const metrics = {
|
|
|
option: "Geometric Difference (α)",
|
|
|
displayName: String.raw`\alpha`,
|
|
|
displayBody: p => String.raw`
|
|
|
- \frac{
|
|
|
- \sigma\left(${p}\right)^{1 - C\left(\left\{\vec{q}\right\}\right) L\left(\left\{\vec{q}\right\}\right)}
|
|
|
- }{
|
|
|
- \Theta\left(${p}\right)^{-1 - C\left(\left\{\vec{q}\right\}\right) L\left(\left\{\vec{q}\right\}\right)}
|
|
|
+ \sigma\left(${p}\right)
|
|
|
+ \Theta\left(${p}\right)^{
|
|
|
+ \sqrt{C\left(\left\{\vec{q}\right\}\right) L\left(\left\{\vec{q}\right\}\right)}
|
|
|
}
|
|
|
`,
|
|
|
evaluate: () => 0, // calculated below
|
|
@@ -134,16 +133,12 @@ const metrics = {
|
|
|
evaluate: data => data.importance,
|
|
|
},
|
|
|
};
|
|
|
-// &C\left(${p}\right) \\
|
|
|
-// - &\left|\frac{\max(\left\{0.4, L\left(${p}\right)\right\})}{0.75} - 1\right| \\
|
|
|
-// + &\frac{1}{2}\tanh{\left(10\left( \frac{\left|${p}\right|}{\left|P\right|} - 0.25 \right)\right)}
|
|
|
|
|
|
const applyMetrics = (data, target) => {
|
|
|
const scores = Object.fromEntries(
|
|
|
Object.entries(metrics)
|
|
|
.map(([name, metric]) => [name, metric.evaluate(data, target)])
|
|
|
);
|
|
|
- const power = target.chroma * target.lightness;
|
|
|
- scores.alpha = Math.pow(scores.sigma, 1 - power) * Math.pow(scores.bigTheta, 1 + power);
|
|
|
+ scores.alpha = scores.sigma * Math.pow(scores.bigTheta, Math.sqrt(target.chroma * target.lightness));
|
|
|
return scores;
|
|
|
};
|