aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--frontend/src/app/_elements/form-model/form-model.component.html2
-rw-r--r--frontend/src/app/_elements/form-model/form-model.component.ts15
2 files changed, 10 insertions, 7 deletions
diff --git a/frontend/src/app/_elements/form-model/form-model.component.html b/frontend/src/app/_elements/form-model/form-model.component.html
index 55c802e9..1f0208fa 100644
--- a/frontend/src/app/_elements/form-model/form-model.component.html
+++ b/frontend/src/app/_elements/form-model/form-model.component.html
@@ -1,4 +1,4 @@
-<div *ngIf="newModel">
+<div *ngIf="newModel!=undefined">
<div id="container">
<div class="ns-row">
diff --git a/frontend/src/app/_elements/form-model/form-model.component.ts b/frontend/src/app/_elements/form-model/form-model.component.ts
index f72ce6de..7831f573 100644
--- a/frontend/src/app/_elements/form-model/form-model.component.ts
+++ b/frontend/src/app/_elements/form-model/form-model.component.ts
@@ -27,11 +27,7 @@ export class FormModelComponent implements AfterViewInit {
@Output() editEvent = new EventEmitter();
ngAfterViewInit(): void {
- this.lossFunction = this.lossFunctions[this.forProblemType][0];
- this.outputLayerActivationFunction = this.outputLayerActivationFunctions[this.forProblemType][0];
-
- this.newModel.lossFunction = this.lossFunction;
- this.newModel.outputLayerActivationFunction = this.outputLayerActivationFunction;
+
}
selectFormControl = new FormControl('', Validators.required);
@@ -82,10 +78,17 @@ export class FormModelComponent implements AfterViewInit {
loadModel(model: Model) {
this.newModel = model;
this.forProblemType = model.type;
+ this.lossFunction = this.lossFunctions[this.forProblemType][0];
+ this.outputLayerActivationFunction = this.outputLayerActivationFunctions[this.forProblemType][0];
+
+ this.newModel.lossFunction = this.lossFunction;
+ this.newModel.outputLayerActivationFunction = this.outputLayerActivationFunction;
+ this.updateGraph();
}
updateGraph() {
- this.graph.update();
+ if(this.newModel)
+ this.graph.update();
}
removeLayer() {