aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements/form-model
diff options
context:
space:
mode:
authorIvan Ljubisavljevic <ivan996sk@gmail.com>2022-04-30 00:45:38 +0200
committerIvan Ljubisavljevic <ivan996sk@gmail.com>2022-04-30 00:45:38 +0200
commit1c723f051d723a743718f11c69e39b7913235bb7 (patch)
tree2987fcc40a9e79d3b0ee1c59531fd1c8126c46d4 /frontend/src/app/_elements/form-model
parent46502957863f8366232b63738f40fd4df4e995fa (diff)
parent7257f187324a59864d7db29c72fdb63f12900f40 (diff)
Merge branch 'redesign' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into redesign
# Conflicts: # frontend/src/app/_elements/folder/folder.component.html # frontend/src/app/_elements/folder/folder.component.ts
Diffstat (limited to 'frontend/src/app/_elements/form-model')
-rw-r--r--frontend/src/app/_elements/form-model/form-model.component.html14
-rw-r--r--frontend/src/app/_elements/form-model/form-model.component.ts46
2 files changed, 28 insertions, 32 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..76601465 100644
--- a/frontend/src/app/_elements/form-model/form-model.component.html
+++ b/frontend/src/app/_elements/form-model/form-model.component.html
@@ -90,17 +90,17 @@
<!--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">
<div class="ns-col" id="layers-control">
<div>Broj Skrivenih Slojeva</div>
- <button class="btn-clear btn-icon" (click)="addLayer()">
+ <button class="btn-clear btn-icon bubble" (click)="addLayer()">
<mat-icon>add</mat-icon>
</button>
<div>{{newModel.hiddenLayers}}</div>
- <button class="btn-clear btn-icon" (click)="removeLayer()">
+ <button class="btn-clear btn-icon bubble" (click)="removeLayer()">
<mat-icon>remove</mat-icon>
</button>
@@ -120,8 +120,8 @@
<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()">
+ <mat-label>Broj neurona svih slojeva</mat-label>
+ <input matInput type="number" min="1" max="18" [(ngModel)]="selectedNumberOfNeurons" (change)="changeAllNumberOfNeurons()">
</mat-form-field>
</div>
<div class="break-2"></div>
@@ -172,11 +172,11 @@
<div class="d-flex flex-row align-items-center justify-content-center tm">
<div class="col-6" style="font-size: 13px;">Broj Ĩvorova</div>
- <button class="btn-clear btn-icon" (click)="addNeuron(i)">
+ <button class="btn-clear btn-icon bubble" (click)="addNeuron(i)">
<mat-icon>add</mat-icon>
</button>
<div class="col-2 text-center">{{newModel.layers[i].neurons}}</div>
- <button class="btn-clear btn-icon" (click)="removeNeuron(i)">
+ <button class="btn-clear btn-icon bubble" (click)="removeNeuron(i)">
<mat-icon>remove</mat-icon>
</button>
</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..2c78cd56 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();
@@ -98,7 +98,7 @@ export class FormModelComponent implements AfterViewInit {
}
}
addNeuron(index: number) {
- if (this.newModel.layers[index].neurons < 100) {
+ if (this.newModel.layers[index].neurons < 18) {
this.newModel.layers[index].neurons += 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();
}
}
-
-
-
+
+
+
}