aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements/form-model/form-model.component.html
blob: 2a8d79a82dc70cf791de09f64039457fbe5a4c8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<div id="container">
    <div class="ns-row">

        <div class="ns-col">
            <mat-form-field class="example-full-width" appearance="fill">
                <mat-label>Naziv</mat-label>
                <input type="text" matInput [(ngModel)]="newModel.name">
            </mat-form-field>
        </div>
        <div class="ns-col">
            <mat-form-field appearance="fill">
                <mat-label>Tip problema</mat-label>
                <mat-select [(ngModel)]="newModel.type">
                    <mat-option *ngFor="let option of Object.keys(ProblemType); let optionName of Object.values(ProblemType)" [value]="option">
                        {{ optionName }}
                    </mat-option>
                </mat-select>
            </mat-form-field>
        </div>

        <div class="break-1"></div>

        <div class="ns-col">
            <mat-form-field appearance="fill">
                <mat-label>Optimizacija</mat-label>
                <mat-select [(ngModel)]="newModel.optimizer">
                    <mat-option *ngFor="let option of Object.keys(Optimizer); let optionName of Object.values(Optimizer)" [value]="option">
                        {{ optionName }}
                    </mat-option>
                </mat-select>

            </mat-form-field>
        </div>
        <div class="ns-col">
            <mat-form-field appearance="fill">
                <mat-label>Funkcija troška</mat-label>
                <mat-select [(ngModel)]="newModel.lossFunction">
                    <mat-option *ngFor="let option of Object.keys(LossFunction); let optionName of Object.values(LossFunction)" [value]="option">
                        {{ optionName }}
                    </mat-option>
                </mat-select>

            </mat-form-field>
        </div>

        <div class="break-2"></div>

        <div class="ns-col">
            <mat-form-field appearance="fill">
                <mat-label>Funkcija aktivacije izlaznog sloja</mat-label>
                <mat-select name="outputLayerActivationFunction" [(ngModel)]="newModel.outputLayerActivationFunction">
                    <mat-option *ngFor="let option of Object.keys(ActivationFunction); let optionName of Object.values(ActivationFunction)" [value]="option">
                        {{ optionName }}
                    </mat-option>
                </mat-select>
            </mat-form-field>
        </div>
        <div class="ns-col">
            <mat-form-field appearance="fill">
                <mat-label>Stopa učenja</mat-label>
                <mat-select [(ngModel)]="newModel.learningRate">
                    <mat-option *ngFor="let option of Object.keys(LearningRate); let optionName of Object.values(LearningRate)" [value]="option">
                        {{ optionName }}
                    </mat-option>
                </mat-select>
            </mat-form-field>
        </div>

        <div class="break-1"></div>

        <div class="ns-col">
            <mat-form-field appearance="fill">
                <mat-label>Broj epoha</mat-label>
                <input type="number" matInput [(ngModel)]="newModel.epochs" min="1" max="1000">
            </mat-form-field>
        </div>
        <div class="ns-col">
            <mat-form-field appearance="fill">
                <mat-label>Broj uzoraka po iteraciji</mat-label>

                <mat-select matNativeControl required [(value)]="newModel.batchSize">
                    <mat-option *ngFor="let option of Object.keys(BatchSize); let optionName of Object.values(BatchSize)" [value]="option">{{option}}</mat-option>
                </mat-select>
            </mat-form-field>
        </div>

    </div>
</div>


<!--kraj unosa parametara-->
<hr>
<div class="m-2">
    <app-graph [model]="newModel" [inputCols]="newModel.inputColNum"></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()">
            <mat-icon>add</mat-icon>
        </button>
        <div>{{newModel.hiddenLayers}}</div>
        <button class="btn-clear btn-icon" (click)="removeLayer()">
            <mat-icon>remove</mat-icon>
        </button>
   
    </div>
    <div class="break-1"></div>
    <div class="ns-col">
        <mat-form-field appearance="fill">
            <mat-label>Aktivaciona funkcija svih slojeva</mat-label>
            
            <mat-select  [(ngModel)]="selectedActivation" (selectionChange)="changeAllActivation()"  >
                <mat-option *ngFor="let option of Object.keys(ActivationFunction); let optionName of Object.values(ActivationFunction)" [value]="option">
                    {{ optionName }}
                </mat-option>
            </mat-select>
        </mat-form-field>
    </div>
   
    <div class="ns-col">
        <mat-form-field appearance="fill">
            <mat-label>Broj Neurona svih slojeva</mat-label>
            <input matInput type="number" [(ngModel)]="selectedNumberOfNeurons" (change)="changeAllNumberOfNeurons()">
        </mat-form-field>
    </div>
    <div class="break-2"></div>
    <div class="ns-col">
        <mat-form-field appearance="fill">
            <mat-label>Regularizacija svih slojeva</mat-label>
            <mat-select [(ngModel)]="selectedRegularisation" (selectionChange)="changeAllRegularisation()">
                <mat-option *ngFor="let option of Object.keys(Regularisation); let optionName of Object.values(Regularisation)" [value]="option">
                    {{ optionName }}
                </mat-option>
            </mat-select>
        </mat-form-field>
    </div>
    
    <div class="ns-col">
        <mat-form-field appearance="fill">
            <mat-label>Stopa regularizacije svih slojeva</mat-label>
            <mat-select [(ngModel)]="selectedRegularisationRate" (selectionChange)="changeAllRegularisationRate()">
                <mat-option *ngFor="let option of Object.keys(RegularisationRate); let optionName of Object.values(RegularisationRate)" [value]="option">
                    {{ optionName }}
                </mat-option>
            </mat-select>
        </mat-form-field>
        </div>


</div>

<!--kraj selectall**********************************************************************************-->
<hr>
<div id="layers">

    <div class="layer" *ngFor="let item of newModel.layers; let i=index">
        <div class="text-center">
            #{{i+1}}
        </div>

        <mat-form-field appearance="fill">
            <mat-label>Aktivaciona funkcija</mat-label>
            <mat-select [(ngModel)]="newModel.layers[i].activationFunction">
                <mat-option *ngFor="let option of Object.keys(ActivationFunction); let optionName of Object.values(ActivationFunction)" [value]="option">
                    {{ optionName }}
                </mat-option>
            </mat-select>
        </mat-form-field>

        <div class="d-flex flex-row align-items-center justify-content-center m-1">
            <div class="col-6" style="font-size: 13px;">Broj čvorova</div>
            <button class="btn-clear btn-icon" (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)">
                <mat-icon>remove</mat-icon>
            </button>
        </div>

        <mat-form-field appearance="fill">
            <mat-label>Regularizacija</mat-label>
            <mat-select [(ngModel)]="newModel.layers[i].regularisation">
                <mat-option *ngFor="let option of Object.keys(Regularisation); let optionName of Object.values(Regularisation)" [value]="option">
                    {{ optionName }}
                </mat-option>
            </mat-select>
        </mat-form-field>

        <mat-form-field appearance="fill">
            <mat-label>Stopa regularizacije</mat-label>
            <mat-select [(ngModel)]="newModel.layers[i].regularisationRate">
                <mat-option *ngFor="let option of Object.keys(RegularisationRate); let optionName of Object.values(RegularisationRate)" [value]="option">
                    {{ optionName }}
                </mat-option>
            </mat-select>
        </mat-form-field>
    </div>
</div>