aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements/form-model
diff options
context:
space:
mode:
authorDanijel Anđelković <adanijel99@gmail.com>2022-04-29 00:44:09 +0200
committerDanijel Anđelković <adanijel99@gmail.com>2022-04-29 00:44:09 +0200
commit9d73bc044eaea6176556935a81db8e654476e6f1 (patch)
treee7a5b8f2ff85d14933df73c1a30ef47ac2a13973 /frontend/src/app/_elements/form-model
parent1b9e3a2470d1123b362ad47725bd76b2eb7b39eb (diff)
Promenio liniju u grafu modela na bezier krivu, dodao ispis ulazne kolone / aktivacione funkcije sloja na hoveru preko cvora.
Diffstat (limited to 'frontend/src/app/_elements/form-model')
-rw-r--r--frontend/src/app/_elements/form-model/form-model.component.html4
-rw-r--r--frontend/src/app/_elements/form-model/form-model.component.ts44
2 files changed, 22 insertions, 26 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 f11b609d..d5187383 100644
--- a/frontend/src/app/_elements/form-model/form-model.component.html
+++ b/frontend/src/app/_elements/form-model/form-model.component.html
@@ -90,7 +90,7 @@
<!--kraj unosa parametara-->
<hr>
<div class="m-2">
- <app-graph [model]="newModel" [inputCols]="newModel.inputColNum"></app-graph>
+ <app-graph [model]="newModel" [inputColumns]="forExperiment?.inputColumns"></app-graph>
</div>
<div class="ns-row">
@@ -121,7 +121,7 @@
<div class="ns-col">
<mat-form-field appearance="fill" class="mat-fix">
<mat-label>Broj Neurona svih slojeva</mat-label>
- <input matInput type="number" [(ngModel)]="selectedNumberOfNeurons" (change)="changeAllNumberOfNeurons()">
+ <input matInput type="number" min="1" max="18" [(ngModel)]="selectedNumberOfNeurons" (change)="changeAllNumberOfNeurons()">
</mat-form-field>
</div>
<div class="break-2"></div>
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 062c380e..e58d1764 100644
--- a/frontend/src/app/_elements/form-model/form-model.component.ts
+++ b/frontend/src/app/_elements/form-model/form-model.component.ts
@@ -60,7 +60,7 @@ export class FormModelComponent implements AfterViewInit {
showMyModels: boolean = true;
updateGraph() {
- console.log(this.newModel.layers);
+ //console.log(this.newModel.layers);
this.graph.update();
}
@@ -73,7 +73,7 @@ export class FormModelComponent implements AfterViewInit {
}
addLayer() {
if (this.newModel.hiddenLayers < 128) {
- this.newModel.layers.push(new Layer(this.newModel.layers.length));
+ this.newModel.layers.push(new Layer(this.newModel.layers.length, this.selectedActivation, this.selectedNumberOfNeurons, this.selectedRegularisation, this.selectedRegularisationRate));
this.newModel.hiddenLayers += 1;
this.updateGraph();
@@ -106,37 +106,33 @@ export class FormModelComponent implements AfterViewInit {
selectedActivation: ActivationFunction = ActivationFunction.Sigmoid;
selectedRegularisationRate: RegularisationRate = RegularisationRate.RR1;
selectedRegularisation: Regularisation = Regularisation.L1;
- selectedNumberOfNeurons:number=1;
+ selectedNumberOfNeurons: number = 3;
+
+ changeAllActivation() {
+ for (let i = 0; i < this.newModel.layers.length; i++) {
+ this.newModel.layers[i].activationFunction = this.selectedActivation;
- 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++)
- {
- this.newModel.layers[i].regularisation=this.selectedRegularisation;
+ changeAllRegularisation() {
+ for (let i = 0; i < this.newModel.layers.length; i++) {
+ this.newModel.layers[i].regularisation = this.selectedRegularisation;
}
}
- changeAllRegularisationRate(){
+ changeAllRegularisationRate() {
- for(let i=0;i<this.newModel.layers.length;i++)
- {
- this.newModel.layers[i].regularisationRate=this.selectedRegularisationRate;
+ for (let i = 0; i < this.newModel.layers.length; i++) {
+ this.newModel.layers[i].regularisationRate = this.selectedRegularisationRate;
}
}
- changeAllNumberOfNeurons(){
- for(let i=0;i<this.newModel.layers.length;i++)
- {
- this.newModel.layers[i].neurons=this.selectedNumberOfNeurons;
+ changeAllNumberOfNeurons() {
+ for (let i = 0; i < this.newModel.layers.length; i++) {
+ this.newModel.layers[i].neurons = this.selectedNumberOfNeurons;
this.updateGraph();
}
}
-
-
-
+
+
+
}