From 781e458149b4c123d0ccfe99c36abc42f2e72055 Mon Sep 17 00:00:00 2001 From: TAMARA JERINIC Date: Wed, 11 May 2022 23:51:26 +0200 Subject: Izmenjen izgled i dodate metrike za iscrtavanje grafika toka obuke. --- .../_elements/metric-view/metric-view.component.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'frontend/src/app/_elements/metric-view/metric-view.component.ts') diff --git a/frontend/src/app/_elements/metric-view/metric-view.component.ts b/frontend/src/app/_elements/metric-view/metric-view.component.ts index 6fd2f320..fbca2edf 100644 --- a/frontend/src/app/_elements/metric-view/metric-view.component.ts +++ b/frontend/src/app/_elements/metric-view/metric-view.component.ts @@ -1,6 +1,5 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core'; import { LineChartComponent } from '../_charts/line-chart/line-chart.component'; - @Component({ selector: 'app-metric-view', templateUrl: './metric-view.component.html', @@ -9,6 +8,7 @@ import { LineChartComponent } from '../_charts/line-chart/line-chart.component'; export class MetricViewComponent implements OnInit { @ViewChild(LineChartComponent) linechartComponent!: LineChartComponent; + constructor() { } ngOnInit(): void { @@ -21,6 +21,10 @@ export class MetricViewComponent implements OnInit { const myMae: number[] = []; const myMse: number[] = []; const myLoss: number[] = []; + const myValLoss: number[] = []; + const myValAcc: number[] = []; + const myValMAE: number[] = []; + const myValMSE: number[] = []; const myEpochs: number[] = []; this.history = history; @@ -41,9 +45,21 @@ export class MetricViewComponent implements OnInit { else if (key === 'mse') { myMse.push(parseFloat(value)); } + else if (key === 'val_acc') { + myValAcc.push(parseFloat(value)); + } + else if (key === 'val_loss') { + myValLoss.push(parseFloat(value)); + } + else if (key === 'val_mae') { + myValMAE.push(parseFloat(value)); + } + else if (key === 'val_mse') { + myValMSE.push(parseFloat(value)); + } } }); - this.linechartComponent.update(myEpochs, myAcc, myLoss, myMae, myMse); + this.linechartComponent.update(myEpochs, myAcc, myLoss, myMae, myMse, myValAcc,myValLoss,myValMAE,myValMSE); } } \ No newline at end of file -- cgit v1.2.3