diff options
author | TAMARA JERINIC <tamara.jerinic@gmail.com> | 2022-05-12 00:48:28 +0200 |
---|---|---|
committer | TAMARA JERINIC <tamara.jerinic@gmail.com> | 2022-05-12 00:48:28 +0200 |
commit | f203736d496c8eb2fb2a11b57c4a60d27f73a850 (patch) | |
tree | 30ad13d2b15f4debc25830ccbbcbf0f68b77be55 /frontend/src/app/_elements/form-model | |
parent | 2734c3593bbbf1aeeeb9724b41ade50471db3340 (diff) |
Dodati hideProblemType i forProblemType u form-model.
Diffstat (limited to 'frontend/src/app/_elements/form-model')
-rw-r--r-- | frontend/src/app/_elements/form-model/form-model.component.html | 7 | ||||
-rw-r--r-- | frontend/src/app/_elements/form-model/form-model.component.ts | 18 |
2 files changed, 12 insertions, 13 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 d13cb3aa..09e44a99 100644 --- a/frontend/src/app/_elements/form-model/form-model.component.html +++ b/frontend/src/app/_elements/form-model/form-model.component.html @@ -11,7 +11,12 @@ <div class="ns-col"> <mat-form-field appearance="fill" class="mat-fix"> <mat-label>Tip problema</mat-label> - <mat-select [(ngModel)]="newModel.type" (selectionChange)="filterLossFunction()" disabled="true"> + <mat-select [(ngModel)]="newModel.type" (selectionChange)="filterLossFunction()" *ngIf="this.hideProblemType" disabled="true"> + <mat-option *ngFor="let option of Object.keys(ProblemType); let optionName of Object.values(ProblemType)" [value]="option"> + {{ optionName }} + </mat-option> + </mat-select> + <mat-select [(ngModel)]="newModel.type" (selectionChange)="filterLossFunction()" *ngIf="!this.hideProblemType" disabled="false"> <mat-option *ngFor="let option of Object.keys(ProblemType); let optionName of Object.values(ProblemType)" [value]="option"> {{ optionName }} </mat-option> 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 a98ceaec..e01c2339 100644 --- a/frontend/src/app/_elements/form-model/form-model.component.ts +++ b/frontend/src/app/_elements/form-model/form-model.component.ts @@ -15,8 +15,13 @@ export class FormModelComponent implements AfterViewInit { @ViewChild(GraphComponent) graph!: GraphComponent; @Input() forExperiment!: Experiment; @Output() selectedModelChangeEvent = new EventEmitter<Model>(); + @Input() hideProblemType:boolean; + @Input() forProblemType:ProblemType; testSetDistribution: number = 70; - constructor() { } + constructor() { + this.hideProblemType=false; + this.forProblemType=ProblemType.BinaryClassification; + } ngAfterViewInit(): void { } @@ -80,13 +85,6 @@ export class FormModelComponent implements AfterViewInit { } } - /* - setNeurons() - { - for(let i=0;i<this.newModel.hiddenLayers;i++){ - this.newModel.hiddenLayerNeurons[i]=1; - } - }*/ numSequence(n: number): Array<number> { return Array(n); } @@ -111,9 +109,7 @@ export class FormModelComponent implements AfterViewInit { changeAllActivation() { for (let i = 0; i < this.newModel.layers.length; i++) { this.newModel.layers[i].activationFunction = this.selectedActivation; - } - } changeAllRegularisation() { for (let i = 0; i < this.newModel.layers.length; i++) { @@ -131,11 +127,9 @@ export class FormModelComponent implements AfterViewInit { this.updateGraph(); } } - updateTestSet(event: MatSliderChange) { this.testSetDistribution = event.value!; } - filterLossFunction() { if(this.newModel.type==ProblemType.Regression){ this.lossFunction = LossFunctionRegression; |