"use client"; import React, { useState, useEffect } from 'react'; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@/components/ui/table"; import { Badge } from "@/components/ui/badge"; import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, Legend } from 'recharts'; import { Skeleton } from "@/components/ui/skeleton"; // Import Skeleton import NeonAnalyzerChart from '@/components/visualizations/NeonAnalyzerChart'; interface PerformanceEpochData { epoch: number; train_acc: number; val_acc: number; train_loss: number; val_loss: number; zpe_effect: number; } export default function LatestPerformance() { const generatePerformanceData = (): PerformanceEpochData[] => { const result: PerformanceEpochData[] = []; for (let epoch = 1; epoch <= 6; epoch++) { result.push({ epoch, train_acc: 95 + (epoch / 6) * 4 + Math.random() * 0.5, val_acc: 94 + (epoch / 6) * 4.5 + Math.random() * 0.7, train_loss: 0.4 - (epoch / 6) * 0.35 + Math.random() * 0.05, val_loss: 0.5 - (epoch / 6) * 0.35 + Math.random() * 0.08, zpe_effect: 0.2 + (epoch / 6) * 0.3 + Math.random() * 0.05 }); } return result; }; const [performanceData, setPerformanceData] = useState([]); useEffect(() => { setPerformanceData(generatePerformanceData()); }, []); const lastEpoch = performanceData.length > 0 ? performanceData[performanceData.length - 1] : null; if (performanceData.length === 0 || !lastEpoch) { return (
{Array(6).fill(0).map((_, i) => (
))}
); } return (
Training Metrics Latest performance across epochs
p.train_acc), color: '#00ffe7', label: 'Train Acc' }, { data: performanceData.map(p => p.val_acc), color: '#ff00ff', label: 'Val Acc' }, ]} width={600} height={380} overlays={[ { text: 'Training Metrics', color: '#39ff14', x: 120, y: 40, fontSize: 24 }, ]} showLegend />
Latest Results Epoch {lastEpoch.epoch} performance
Metric Value Training Accuracy {lastEpoch.train_acc.toFixed(2)}% Validation Accuracy {lastEpoch.val_acc.toFixed(2)}% Training Loss {lastEpoch.train_loss.toFixed(4)} Validation Loss {lastEpoch.val_loss.toFixed(4)} ZPE Effect (Avg) {lastEpoch.zpe_effect.toFixed(3)}

ZPE Effects by Layer (Conceptual)

{[0.12, 0.18, 0.24, 0.35, 0.11, 0.09].map((value, i) => ( // Assuming static for now
{i+1}
))}

Test Time Augmentation (Conceptual)

Validation: {lastEpoch.val_acc.toFixed(2)}%
With TTA: {(lastEpoch.val_acc + 0.6 + Math.random() * 0.2).toFixed(2)}%
); }