aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements/metric-view/metric-view.component.ts
diff options
context:
space:
mode:
authorTAMARA JERINIC <tamara.jerinic@gmail.com>2022-05-11 23:51:26 +0200
committerTAMARA JERINIC <tamara.jerinic@gmail.com>2022-05-11 23:51:26 +0200
commit781e458149b4c123d0ccfe99c36abc42f2e72055 (patch)
tree4b1101005e278712eaf3d450b3c072d97bd5b50b /frontend/src/app/_elements/metric-view/metric-view.component.ts
parent1690c70e86e5f79fa5708ea12ed034bf605cf259 (diff)
Izmenjen izgled i dodate metrike za iscrtavanje grafika toka obuke.
Diffstat (limited to 'frontend/src/app/_elements/metric-view/metric-view.component.ts')
-rw-r--r--frontend/src/app/_elements/metric-view/metric-view.component.ts20
1 files changed, 18 insertions, 2 deletions
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