-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha64.asm
64 lines (48 loc) · 1.81 KB
/
a64.asm
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
bits 64
%include "kras.asm"
section .data
customEpochs: dq 200
customBatchSize : dq 2
customLearningRate: dq -0.03
customExportLossFileName: db "mixedLossHistory.bin",0
customExportWeightsFileName: db "myCnnWeightsSaved.bin",0
customImportWeightsFileName: db "myCnnWeightsLoaded.bin",0
customExportVerificationSquareFileName: db "squareVerif20per20.bin",0
section .text
global _start
_start:
call krasInitialise
; Add {input, dense and output} layers
addLayerParameters 2, TF_LINEAR, TF_NO_BIASES, TF_ZERO
call krasAddLayer
addLayerParameters 4, TF_TANH, TF_NO_BIASES, TF_ZERO
call krasAddLayer
addLayerParameters 9, TF_TANH , TF_NO_BIASES, TF_ZERO
call krasAddLayer
addLayerParameters 2, TF_SOFTMAX, TF_NO_BIASES, TF_ZERO
call krasAddLayer
; Set up the CNN, by compiling it
call krasCompile
; Possibly load existing weights
;loadParameters qword customImportWeightsFileName
;call krasLoadWeights
; Get a reference value of the initial output of the CNN
fitParameters 1, 1, [customLearningRate]
fitExtraParameters TF_TRUE
call krasFit
call krasShowOutput
; Fit it
fitParameters [customEpochs], [customBatchSize], [customLearningRate]
fitExtraParameters TF_TRUE
call krasFit
call krasShowOutput
; Miscellaneous
call krasShowLossHistory
; Possibly export stuff
;saveParameters qword customExportLossFileName
;call krasSaveLoss
;saveParameters qword customExportWeightsFileName
;call krasSaveWeights
;saveParameters qword customExportVerificationSquareFileName
;call krasSaveVerificationSquare
call quit