Kirk Trombley пре 3 година
родитељ
комит
442edbfb24
1 измењених фајлова са 4 додато и 9 уклоњено
  1. 4 9
      web/metrics.js

+ 4 - 9
web/metrics.js

@@ -3,10 +3,9 @@ const metrics = {
     option: "Geometric Difference (α)",
     option: "Geometric Difference (α)",
     displayName: String.raw`\alpha`,
     displayName: String.raw`\alpha`,
     displayBody: p => String.raw`
     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
     evaluate: () => 0, // calculated below
@@ -134,16 +133,12 @@ const metrics = {
     evaluate: data => data.importance,
     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 applyMetrics = (data, target) => {
   const scores = Object.fromEntries(
   const scores = Object.fromEntries(
     Object.entries(metrics)
     Object.entries(metrics)
       .map(([name, metric]) => [name, metric.evaluate(data, target)])
       .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;
   return scores;
 };
 };