Refactor: 변수명 수정

This commit is contained in:
정현조 2024-09-25 08:53:34 +09:00
parent 56f63f59f2
commit 14c53e26d8
3 changed files with 25 additions and 24 deletions

View File

@ -92,9 +92,9 @@ function ModelEvaluation({ projectId, selectedModel }: ModelEvaluationProps) {
<ModelLineChart
data={reportData.map((report) => ({
epoch: report.epoch.toString(),
loss1: report.boxLoss,
loss2: report.clsLoss,
loss3: report.dflLoss,
boxLoss: report.boxLoss,
classLoss: report.clsLoss,
dflLoss: report.dflLoss,
fitness: report.fitness,
}))}
/>

View File

@ -6,9 +6,9 @@ import { ChartConfig, ChartContainer } from '@/components/ui/chart';
interface MetricData {
epoch: string;
loss1?: number;
loss2?: number;
loss3?: number;
boxLoss?: number;
classLoss?: number;
dflLoss?: number;
fitness?: number;
}
@ -20,16 +20,16 @@ interface ModelLineChartProps {
}
const chartConfig = {
loss1: {
label: 'Loss 1',
boxLoss: {
label: 'Box Loss',
color: '#FF6347',
},
loss2: {
label: 'Loss 2',
classLoss: {
label: 'Class Loss',
color: '#1E90FF',
},
loss3: {
label: 'Loss 3',
dflLoss: {
label: 'DFL Loss',
color: '#32CD32',
},
fitness: {
@ -41,9 +41,9 @@ const chartConfig = {
export default function ModelLineChart({ data, currentEpoch, totalEpochs, remainingTime }: ModelLineChartProps) {
const emptyData = Array.from({ length: totalEpochs || 0 }, (_, i) => ({
epoch: (i + 1).toString(),
loss1: null,
loss2: null,
loss3: null,
boxLoss: null,
classLoss: null,
dflLoss: null,
fitness: null,
}));
@ -86,23 +86,23 @@ export default function ModelLineChart({ data, currentEpoch, totalEpochs, remain
<Tooltip />
<Legend />
<Line
dataKey="loss1"
dataKey="boxLoss"
type="monotone"
stroke={chartConfig.loss1.color}
stroke={chartConfig.boxLoss.color}
strokeWidth={2}
dot={false}
/>
<Line
dataKey="loss2"
dataKey="classLoss"
type="monotone"
stroke={chartConfig.loss2.color}
stroke={chartConfig.classLoss.color}
strokeWidth={2}
dot={false}
/>
<Line
dataKey="loss3"
dataKey="dflLoss"
type="monotone"
stroke={chartConfig.loss3.color}
stroke={chartConfig.dflLoss.color}
strokeWidth={2}
dot={false}
/>

View File

@ -29,6 +29,7 @@ export default function TrainingGraph({ projectId, selectedModel }: TrainingGrap
const trainingDataList = useMemo(() => {
return trainingDataByProject[projectId?.toString() || ''] || fetchedTrainingDataList || [];
}, [projectId, trainingDataByProject, fetchedTrainingDataList]);
useEffect(() => {
if (fetchedTrainingDataList) {
saveTrainingData(projectId?.toString() || '', fetchedTrainingDataList);
@ -57,9 +58,9 @@ export default function TrainingGraph({ projectId, selectedModel }: TrainingGrap
data={
trainingDataList?.map((data) => ({
epoch: data.epoch.toString(),
loss1: data.boxLoss,
loss2: data.clsLoss,
loss3: data.dflLoss,
boxLoss: data.boxLoss,
classLoss: data.clsLoss,
dflLoss: data.dflLoss,
fitness: data.fitness,
})) || []
}