aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_elements/form-model/form-model.component.html
blob: 4c5505f0a4874dc3c6150dd3d4583508b8495dbe (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
<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 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>
<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-1">{{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>