-
Notifications
You must be signed in to change notification settings - Fork 1
/
debug.jl
148 lines (140 loc) · 2.58 KB
/
debug.jl
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
using BioSim
using BenchmarkTools
genomeStr = randGenomeStr(16)
genome = @btime Genome(genomeStr)
# mutable gene -> 5.927 μs (106 allocations: 4.59 KiB)
# immutable gene-> 6.007 μs (93 allocations: 4.44 KiB)
nn = @btime NeuralNet(genome)
# 1.220 μs (5 allocations: 432 bytes)
genomeTest1 = [
"8181ffff"
] # correct output: []
genomeTest2 = [
"0181ffff",
"8101ffff",
"8105ffff"
] # correct output: [1]
genomeTest2a = [
"0281ffff",
"0102ffff",
"8101ffff"
] # correct output: [1,2]
genomeTest3 = [
"0181abcd",
"0102bbcd",
"0201ffff",
"0202aaaa",
"81021111",
"01032222"
] # correct output: [1,2]
genomeTest4 = [
"8101aaaa",
"0181bbbb",
"0182cccc"
] # correct output: [1]
genomeTest5 = [
"8101aaaa",
"0181bbbb",
"8202aaaa",
"0281bbbb"
] # correct output: [1,2]
genomeTest5a = [
"8101aaaa",
"0181bbbb",
"8203aaaa",
"0281bbbb",
"0203ffff",
"0302ffff",
"0381aaaa"
] # correct output: [1,2,3]
genomeTest5b = [
"8101aaaa",
"0181bbbb",
"8203aaaa",
"0281bbbb",
"0203ffff",
"0302ffff",
"0381aaaa",
"0401abcd",
"0104abcd",
"0305dddd"
] # correct output: [1,2,3,4]
genomeTest6 = [
"8104aaaa",
"8105aaaa",
"8103aaaa",
"0402bbbb",
"0505cccc",
"0502cccc",
"0203dddd",
"0201eeee",
"0301eeee",
"0181abcd"
] # correct output: [1:5]
genomeTest7 = [
"8107aaaa",
"8209aaaa",
"0705bbbb",
"0808bbbb",
"0806bbbb",
"0905bbbb",
"0906bbbb",
"0481cccc",
"0501cccc",
"0606cccc",
"0602cccc",
"0603cccc",
"0181dddd",
"0282dddd"
] # correct output: [1,2,4,5,6,7,8,9]
genomeTest8 = [
"8101aaaa",
"0181cccc",
"0201bbbb",
"0202bbbb"
] # correct output: [1,2]
genomeTest9 = [
"8101aaaa",
"0102bbbb",
"0181cccc"
] # correct output: [1]
genomeTest10 = [
"8101aaaa",
"8102aaaa",
"0181bbbb"
] # correct output: [1]
genomeTest11 = [
"8182aaaa",
"0101bbbb",
"0181bbbb",
"0182bbbb"
] # correct output: [1]
genomeTest12 = [
"8181aaaa",
"8202aaaa",
"0181bbbb",
"0182bbbb",
"0102bbbb",
"0202bbbb",
"0283bbbb"
] # correct output: [1,2]
tests = [
genomeTest1,
genomeTest2,
genomeTest2a,
genomeTest3,
genomeTest4,
genomeTest5,
genomeTest5a,
genomeTest5b,
genomeTest6,
genomeTest7,
genomeTest8,
genomeTest9,
genomeTest10,
genomeTest11,
genomeTest12
]
usedNeuron = Vector{Int}()
getUsedNeuron!(Gene.(genomeTest2), usedNeuron)
tests_result = map(x->getUsedNeuron!(Gene.(x),usedNeuron), tests)