Parse single epoch training curves

This commit is contained in:
2026-06-30 23:42:11 +08:00
parent 3e9e8ba6f5
commit 6b3a3d7c6d
3 changed files with 39 additions and 12 deletions

View File

@@ -1764,17 +1764,24 @@ function MiniCurvePlot({ series }: { series: CurveSeries[] }) {
{[0.25, 0.5, 0.75].map((tick) => (
<path key={tick} d={`M ${pad} ${pad + tick * (height - pad * 2)} H ${width - pad}`} className="gridLine" />
))}
{series.map((item, index) => (
<polyline
key={item.name}
points={item.points.map((point) => `${scaleX(point.x).toFixed(2)},${scaleY(point.y).toFixed(2)}`).join(" ")}
fill="none"
stroke={curveColor(index)}
strokeWidth="2.4"
strokeLinejoin="round"
strokeLinecap="round"
/>
))}
{series.map((item, index) => {
const color = curveColor(index);
const scaled = item.points.map((point) => ({ x: scaleX(point.x), y: scaleY(point.y) }));
if (scaled.length === 1) {
return <circle key={item.name} cx={scaled[0].x} cy={scaled[0].y} r="4" fill={color} />;
}
return (
<polyline
key={item.name}
points={scaled.map((point) => `${point.x.toFixed(2)},${point.y.toFixed(2)}`).join(" ")}
fill="none"
stroke={color}
strokeWidth="2.4"
strokeLinejoin="round"
strokeLinecap="round"
/>
);
})}
</svg>
);
}