maxidl commited on
Commit
6a172ea
Β·
verified Β·
1 Parent(s): cabe308

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +19 -19
index.html CHANGED
@@ -604,14 +604,17 @@
604
  return ticks;
605
  }
606
 
607
- function movingAverage(values, w) {
608
- if (w <= 1) return values;
609
- return values.map((_, i) => {
610
- const n = Math.min(i + 1, w);
611
- let sum = 0;
612
- for (let j = i - n + 1; j <= i; j++) sum += values[j];
613
- return sum / n;
614
- });
 
 
 
615
  }
616
 
617
  // ── Task quality metrics ─────────────────────────────────────
@@ -973,14 +976,8 @@
973
  <select id="pmetric-${this.id}"></select>
974
  </div>
975
  <div class="control-group">
976
- <label>Smoothing</label>
977
- <select id="psmooth-${this.id}">
978
- <option value="1" selected>None</option>
979
- <option value="2">2</option>
980
- <option value="3">3</option>
981
- <option value="4">4</option>
982
- <option value="5">5</option>
983
- </select>
984
  </div>
985
  <div class="control-group">
986
  <label>Chart Type</label>
@@ -1050,7 +1047,10 @@
1050
  this.el.suite.addEventListener('change', () => this.onSuiteChange());
1051
  this.el.task.addEventListener('change', () => this.onTaskChange());
1052
  this.el.metric.addEventListener('change', () => this.renderChart());
1053
- this.el.smooth.addEventListener('change', () => this.renderChart());
 
 
 
1054
  this.el.chartType.addEventListener('change', () => this.renderChart());
1055
  this.el.xTicks.addEventListener('change', () => this.renderChart());
1056
 
@@ -1183,7 +1183,7 @@
1183
  }
1184
 
1185
  getSmoothing() {
1186
- return parseInt(this.el.smooth.value, 10) || 1;
1187
  }
1188
 
1189
  getChartType() {
@@ -1659,7 +1659,7 @@
1659
  if (d.isCheckpoint && validPoints.length > 1) {
1660
  traces.push({
1661
  x: validPoints.map(p => p.x),
1662
- y: movingAverage(validPoints.map(p => p.y), w),
1663
  name, mode: 'lines+markers',
1664
  line: { color, width: 2 }, marker: { size: 5 },
1665
  });
 
604
  return ticks;
605
  }
606
 
607
+ function exponentialMovingAverage(values, alpha) {
608
+ if (alpha <= 0) return values;
609
+ const result = [];
610
+ let ema = 0;
611
+ let debiasWeight = 0;
612
+ for (let i = 0; i < values.length; i++) {
613
+ ema = alpha * ema + (1 - alpha) * values[i];
614
+ debiasWeight = alpha * debiasWeight + (1 - alpha);
615
+ result.push(ema / debiasWeight);
616
+ }
617
+ return result;
618
  }
619
 
620
  // ── Task quality metrics ─────────────────────────────────────
 
976
  <select id="pmetric-${this.id}"></select>
977
  </div>
978
  <div class="control-group">
979
+ <label>Smoothing: <span id="psmooth-val-${this.id}">0</span></label>
980
+ <input type="range" id="psmooth-${this.id}" min="0" max="0.99" step="0.01" value="0" style="width:120px;vertical-align:middle">
 
 
 
 
 
 
981
  </div>
982
  <div class="control-group">
983
  <label>Chart Type</label>
 
1047
  this.el.suite.addEventListener('change', () => this.onSuiteChange());
1048
  this.el.task.addEventListener('change', () => this.onTaskChange());
1049
  this.el.metric.addEventListener('change', () => this.renderChart());
1050
+ this.el.smooth.addEventListener('input', () => {
1051
+ panel.querySelector(`#psmooth-val-${this.id}`).textContent = this.el.smooth.value;
1052
+ this.renderChart();
1053
+ });
1054
  this.el.chartType.addEventListener('change', () => this.renderChart());
1055
  this.el.xTicks.addEventListener('change', () => this.renderChart());
1056
 
 
1183
  }
1184
 
1185
  getSmoothing() {
1186
+ return parseFloat(this.el.smooth.value) || 0;
1187
  }
1188
 
1189
  getChartType() {
 
1659
  if (d.isCheckpoint && validPoints.length > 1) {
1660
  traces.push({
1661
  x: validPoints.map(p => p.x),
1662
+ y: exponentialMovingAverage(validPoints.map(p => p.y), w),
1663
  name, mode: 'lines+markers',
1664
  line: { color, width: 2 }, marker: { size: 5 },
1665
  });