pyerualjetwork 1.1.7__py3-none-any.whl → 1.2.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plan/__init__.py +1 -1
- plan/plan.py +221 -180
- pyerualjetwork-1.2.9.dist-info/METADATA +17 -0
- pyerualjetwork-1.2.9.dist-info/RECORD +6 -0
- {pyerualjetwork-1.1.7.dist-info → pyerualjetwork-1.2.9.dist-info}/WHEEL +1 -1
- pyerualjetwork-1.1.7.dist-info/METADATA +0 -8
- pyerualjetwork-1.1.7.dist-info/RECORD +0 -6
- {pyerualjetwork-1.1.7.dist-info → pyerualjetwork-1.2.9.dist-info}/top_level.txt +0 -0
plan/__init__.py
CHANGED
@@ -2,4 +2,4 @@
|
|
2
2
|
|
3
3
|
# Bu dosya, plan modülünün ana giriş noktasıdır.
|
4
4
|
|
5
|
-
from .plan import AutoBalancer, Normalization, Softmax, Sigmoid, Relu, SynapticPruning, SynapticDividing, WeightIdentification, Fex, Cat, TrainPLAN, TestPLAN, SavePLAN, LoadPLAN, PredictFromDiscPLAN, PredictFromRamPLAN
|
5
|
+
from .plan import AutoBalancer, Normalization, Softmax, Sigmoid, Relu, SynapticPruning, SynapticDividing, WeightIdentification, Fex, Cat, TrainPLAN, TestPLAN, SavePLAN, LoadPLAN, PredictFromDiscPLAN, PredictFromRamPLAN, GetWeights, GetDf, GetPreds, GetAcc
|
plan/plan.py
CHANGED
@@ -3,80 +3,91 @@ import time
|
|
3
3
|
from colorama import Fore,Style
|
4
4
|
from typing import List, Union
|
5
5
|
import math
|
6
|
+
from scipy.special import expit, softmax
|
7
|
+
import matplotlib.pyplot as plt
|
8
|
+
import seaborn as sns
|
9
|
+
|
6
10
|
# BUILD -----
|
7
11
|
def TrainPLAN(
|
8
|
-
|
9
|
-
|
12
|
+
TrainInputs: List[Union[int, float]],
|
13
|
+
TrainLabels: List[Union[int, float, str]], # At least two.. and one hot encoded
|
10
14
|
ClassCount: int,
|
11
15
|
Layers: List[str],
|
12
16
|
Neurons: List[Union[int, float]],
|
13
|
-
|
14
|
-
|
17
|
+
MembranThresholds: List[str],
|
18
|
+
MembranPotentials: List[Union[int, float]],
|
15
19
|
Normalizations: List[str],
|
16
|
-
Activations: List[str]
|
20
|
+
Activations: List[str],
|
21
|
+
Visualize: str
|
17
22
|
) -> str:
|
18
23
|
|
19
24
|
infoPLAN = """
|
20
25
|
Creates and configures a PLAN model.
|
21
26
|
|
22
27
|
Args:
|
23
|
-
|
24
|
-
|
28
|
+
TrainInputs (list[num]): List of input data.
|
29
|
+
TrainLabels (list[num]): List of TrainLabels. (one hot encoded)
|
25
30
|
ClassCount (int): Number of classes.
|
26
31
|
Layers (list[str]): List of layer names. (options: 'fex' (Feature Extraction), 'cat' (Catalyser))
|
27
32
|
Neurons (list[num]): List of neuron counts for each layer.
|
28
|
-
|
29
|
-
|
33
|
+
MembranThresholds (list[str]): List of MembranThresholds.
|
34
|
+
MembranPotentials (list[num]): List of MembranPotentials.
|
30
35
|
Normalizations (List[str]): Whether normalization will be performed at indexed layers ("y" or "n").
|
31
36
|
Activations (list[str]): List of activation functions.
|
37
|
+
Visualize (str): Visualize Training procces or not visualize ('y' or 'n')
|
32
38
|
|
33
39
|
Returns:
|
34
|
-
list([num]): (Weight matrices list, TrainPredictions list
|
40
|
+
list([num]): (Weight matrices list, TrainPredictions list, TrainAcc).
|
35
41
|
error handled ?: Process status ('e')
|
36
42
|
"""
|
37
43
|
|
44
|
+
if Visualize != 'y' and Visualize != 'n':
|
45
|
+
print(Fore.RED + "ERROR109: Visualize parameter must be 'y' or 'n'. TrainPLAN",infoPLAN)
|
46
|
+
return 'e'
|
47
|
+
|
48
|
+
|
38
49
|
LastNeuron = Neurons[-1:][0]
|
39
50
|
if LastNeuron != ClassCount:
|
40
51
|
print(Fore.RED + "ERROR108: Last layer of neuron count must be equal class count. from: TrainPLAN",infoPLAN)
|
41
52
|
return 'e'
|
42
53
|
|
43
|
-
if len(Normalizations) != len(
|
54
|
+
if len(Normalizations) != len(MembranPotentials):
|
44
55
|
|
45
|
-
print(Fore.RED + "ERROR307: Normalization list length must be equal to length of
|
56
|
+
print(Fore.RED + "ERROR307: Normalization list length must be equal to length of MembranThresholds List,MembranPotentials List,Layers List,Neurons List. from: TrainPLAN",infoPLAN)
|
46
57
|
return 'e'
|
47
58
|
|
48
|
-
if len(
|
49
|
-
print(Fore.RED + "ERROR301:
|
59
|
+
if len(TrainInputs) != len(TrainLabels):
|
60
|
+
print(Fore.RED + "ERROR301: TrainInputs list and TrainLabels list must be same length.",infoPLAN)
|
50
61
|
return 'e'
|
51
62
|
|
52
|
-
for i, Value in enumerate(
|
63
|
+
for i, Value in enumerate(MembranPotentials):
|
53
64
|
|
54
65
|
if Normalizations[i] != 'y' and Normalizations[i] != 'n':
|
55
66
|
print(Fore.RED + "ERROR105: Normalization list must be 'y' or 'n'.",infoPLAN)
|
56
67
|
return 'e'
|
57
68
|
|
58
|
-
if
|
69
|
+
if MembranThresholds[i] == 'none':
|
59
70
|
print(Fore.MAGENTA + "WARNING102: We are advise to do not put 'none' Threshold sign. But some cases improves performance of the model from: TrainPLAN",infoPLAN + Style.RESET_ALL)
|
60
71
|
time.sleep(3)
|
61
72
|
|
62
73
|
if isinstance(Value, str):
|
63
|
-
print(Fore.RED + "ERROR201:
|
74
|
+
print(Fore.RED + "ERROR201: MEMBRAN POTENTIALS must be numeric. from: TrainPLAN")
|
64
75
|
return 'e'
|
65
76
|
|
66
77
|
if isinstance(Neurons[i], str):
|
67
78
|
print(Fore.RED + "ERROR202: Neurons list must be numeric.")
|
68
79
|
return 'e'
|
69
80
|
|
70
|
-
if len(
|
71
|
-
print(Fore.RED + "ERROR302:
|
81
|
+
if len(MembranThresholds) != len(MembranPotentials):
|
82
|
+
print(Fore.RED + "ERROR302: MEMBRAN THRESHOLDS list and MEMBRAN POTENTIALS list must be same length. from: TrainPLAN",infoPLAN)
|
72
83
|
return 'e'
|
73
84
|
|
74
85
|
if len(Layers) != len(Neurons):
|
75
86
|
print(Fore.RED + "ERROR303: Layers list and Neurons list must same length. from: TrainPLAN",infoPLAN)
|
76
87
|
return 'e'
|
77
88
|
|
78
|
-
if len(
|
79
|
-
print(Fore.RED + "ERROR306:
|
89
|
+
if len(MembranPotentials) != len(Layers) or len(MembranThresholds) != len(Layers):
|
90
|
+
print(Fore.RED + "ERROR306: MEMBRAN POTENTIALS and MEMBRAN THRESHOLDS lists length must be same Layers list length. from: TrainPLAN",infoPLAN)
|
80
91
|
return 'e'
|
81
92
|
|
82
93
|
|
@@ -103,60 +114,59 @@ def TrainPLAN(
|
|
103
114
|
print(Fore.RED + "ERROR107: Layers list must be 'fex'(Feature Extraction Layer) or 'cat' (Catalyser Layer). from: TrainPLAN",infoPLAN)
|
104
115
|
return 'e'
|
105
116
|
|
106
|
-
if len(
|
107
|
-
print(Fore.RED + "ERROR305:
|
117
|
+
if len(MembranThresholds) != len(MembranPotentials):
|
118
|
+
print(Fore.RED + "ERROR305: MEMBRAN THRESHOLDS list and MEMBRAN POTENTIALS list must be same length. from: TrainPLAN",infoPLAN)
|
108
119
|
return 'e'
|
109
120
|
|
110
121
|
|
111
|
-
for i, Sign in enumerate(
|
122
|
+
for i, Sign in enumerate(MembranThresholds):
|
112
123
|
if Sign != '>' and Sign != '<' and Sign != '==' and Sign != '!=' and Sign != 'none':
|
113
|
-
print(Fore.RED + "ERROR104:
|
124
|
+
print(Fore.RED + "ERROR104: MEMBRAN THRESHOLDS must be '>' or '<' or '==' or '!='. or 'none' WE SUGGEST '<' FOR FEX LAYER AND '==' FOR CAT LAYER (Your data, your hyperparameter) from: TrainPLAN",infoPLAN)
|
114
125
|
return 'e'
|
115
126
|
|
116
127
|
if Layers[i] == 'fex' and Sign == 'none':
|
117
128
|
print(Fore.RED + "ERROR109: at layer type 'fex', pairing with 'none' Threshold is not acceptlable. if you want to 'none' put '==' and make threshold value '0'. from: TrainPLAN ",infoPLAN)
|
118
129
|
return 'e'
|
119
130
|
|
120
|
-
|
121
|
-
for sublist in
|
131
|
+
UniqueTrainLabels = set()
|
132
|
+
for sublist in TrainLabels:
|
122
133
|
|
123
|
-
|
134
|
+
UniqueTrainLabels.add(tuple(sublist))
|
124
135
|
|
125
136
|
|
126
|
-
|
137
|
+
UniqueTrainLabels = list(UniqueTrainLabels)
|
127
138
|
|
128
|
-
|
139
|
+
TrainLabels = [tuple(sublist) for sublist in TrainLabels]
|
129
140
|
|
130
141
|
|
131
|
-
if len(
|
142
|
+
if len(UniqueTrainLabels) != ClassCount:
|
132
143
|
print(Fore.RED + "ERROR106: Label variety length must be same Class Count. from: TrainPLAN",infoPLAN)
|
133
144
|
return 'e'
|
134
145
|
|
135
|
-
|
136
|
-
|
137
|
-
|
146
|
+
TrainInputs[0] = np.array(TrainInputs[0])
|
147
|
+
TrainInputs[0] = TrainInputs[0].ravel()
|
148
|
+
TrainInputsize = len(TrainInputs[0])
|
138
149
|
|
139
|
-
W = WeightIdentification(len(Layers) - 1,ClassCount,Neurons,
|
150
|
+
W = WeightIdentification(len(Layers) - 1,ClassCount,Neurons,TrainInputsize)
|
140
151
|
Divides = SynapticDividing(ClassCount,W)
|
141
152
|
TrainedWs = [1] * len(W)
|
142
153
|
print(Fore.GREEN + "Train Started with 0 ERROR" + Style.RESET_ALL,)
|
143
|
-
TrainPredictions = [
|
154
|
+
TrainPredictions = [None] * len(TrainLabels)
|
144
155
|
true = 0
|
145
|
-
Inputs, Labels = AutoBalancer(Inputs, Labels, ClassCount)
|
146
156
|
StartTime = time.time()
|
147
|
-
for index, inp in enumerate(
|
157
|
+
for index, inp in enumerate(TrainInputs):
|
148
158
|
UniStartTime = time.time()
|
149
159
|
inp = np.array(inp)
|
150
160
|
inp = inp.ravel()
|
151
161
|
|
152
|
-
if
|
153
|
-
print(Fore.RED +"ERROR304: All input matrices or vectors in
|
162
|
+
if TrainInputsize != len(inp):
|
163
|
+
print(Fore.RED +"ERROR304: All input matrices or vectors in TrainInputs list, must be same size. from: TrainPLAN",infoPLAN + Style.RESET_ALL)
|
154
164
|
return 'e'
|
155
165
|
|
156
166
|
|
157
|
-
for Ulindex, Ul in enumerate(
|
167
|
+
for Ulindex, Ul in enumerate(UniqueTrainLabels):
|
158
168
|
|
159
|
-
if Ul ==
|
169
|
+
if Ul == TrainLabels[index]:
|
160
170
|
for Windex, w in enumerate(W):
|
161
171
|
for i, ul in enumerate(Ul):
|
162
172
|
if ul == 1.0:
|
@@ -180,16 +190,34 @@ def TrainPLAN(
|
|
180
190
|
NeuralLayer = Softmax(NeuralLayer)
|
181
191
|
|
182
192
|
if Layer == 'fex':
|
183
|
-
NeuralLayer,W[Lindex] = Fex(NeuralLayer, W[Lindex],
|
193
|
+
NeuralLayer,W[Lindex] = Fex(NeuralLayer, W[Lindex], MembranThresholds[Lindex], MembranPotentials[Lindex])
|
184
194
|
elif Layer == 'cat':
|
185
|
-
NeuralLayer,W[Lindex] = Cat(NeuralLayer, W[Lindex],
|
195
|
+
NeuralLayer,W[Lindex] = Cat(NeuralLayer, W[Lindex], MembranThresholds[Lindex], MembranPotentials[Lindex],1)
|
186
196
|
|
187
|
-
RealOutput = np.argmax(
|
197
|
+
RealOutput = np.argmax(TrainLabels[index])
|
188
198
|
PredictedOutput = np.argmax(NeuralLayer)
|
189
199
|
if RealOutput == PredictedOutput:
|
190
200
|
true += 1
|
191
|
-
Acc = true / len(
|
192
|
-
TrainPredictions[index] = PredictedOutput
|
201
|
+
Acc = true / len(TrainLabels)
|
202
|
+
TrainPredictions[index] = PredictedOutput
|
203
|
+
|
204
|
+
if Visualize == 'y':
|
205
|
+
|
206
|
+
TrainLabelsVisual = np.copy(TrainLabels)
|
207
|
+
TrainLabelsVisual = np.argmax(TrainLabelsVisual, axis=1)
|
208
|
+
|
209
|
+
plt.figure(figsize=(12, 6))
|
210
|
+
sns.kdeplot(TrainLabelsVisual, label='Real Outputs', shade=True)
|
211
|
+
sns.kdeplot(TrainPredictions, label='Predictions', shade=True)
|
212
|
+
plt.legend()
|
213
|
+
plt.xlabel('Class')
|
214
|
+
plt.ylabel('Data size')
|
215
|
+
plt.title('Predictions and Real Outputs for Training KDE Plot')
|
216
|
+
plt.show()
|
217
|
+
|
218
|
+
if index + 1 != len(TrainInputs):
|
219
|
+
|
220
|
+
plt.close('all')
|
193
221
|
|
194
222
|
if index == 0:
|
195
223
|
for i, w in enumerate(W):
|
@@ -200,12 +228,12 @@ def TrainPLAN(
|
|
200
228
|
TrainedWs[i] = TrainedWs[i] + w
|
201
229
|
|
202
230
|
|
203
|
-
W = WeightIdentification(len(Layers) - 1,ClassCount,Neurons,
|
231
|
+
W = WeightIdentification(len(Layers) - 1,ClassCount,Neurons,TrainInputsize)
|
204
232
|
|
205
233
|
|
206
234
|
UniEndTime = time.time()
|
207
235
|
|
208
|
-
CalculatingEst = round((UniEndTime - UniStartTime) * (len(
|
236
|
+
CalculatingEst = round((UniEndTime - UniStartTime) * (len(TrainInputs) - index),3)
|
209
237
|
|
210
238
|
if CalculatingEst < 60:
|
211
239
|
print('\rest......(sec):',CalculatingEst,'\n',end= "")
|
@@ -246,7 +274,7 @@ def TrainPLAN(
|
|
246
274
|
|
247
275
|
|
248
276
|
|
249
|
-
return TrainedWs,TrainPredictions
|
277
|
+
return TrainedWs,TrainPredictions,Acc
|
250
278
|
|
251
279
|
# FUNCTIONS -----
|
252
280
|
|
@@ -254,7 +282,7 @@ def WeightIdentification(
|
|
254
282
|
LayerCount, # int: Number of layers in the neural network.
|
255
283
|
ClassCount, # int: Number of classes in the classification task.
|
256
284
|
Neurons, # list[num]: List of neuron counts for each layer.
|
257
|
-
|
285
|
+
TrainInputsize # int: Size of the input data.
|
258
286
|
) -> str:
|
259
287
|
"""
|
260
288
|
Identifies the weights for a neural network model.
|
@@ -263,7 +291,7 @@ def WeightIdentification(
|
|
263
291
|
LayerCount (int): Number of layers in the neural network.
|
264
292
|
ClassCount (int): Number of classes in the classification task.
|
265
293
|
Neurons (list[num]): List of neuron counts for each layer.
|
266
|
-
|
294
|
+
TrainInputsize (int): Size of the input data.
|
267
295
|
|
268
296
|
Returns:
|
269
297
|
list([numpy_arrays],[...]): Weight matices of the model. .
|
@@ -272,7 +300,7 @@ def WeightIdentification(
|
|
272
300
|
|
273
301
|
Wlen = LayerCount + 1
|
274
302
|
W = [None] * Wlen
|
275
|
-
W[0] = np.ones((Neurons[0],
|
303
|
+
W[0] = np.ones((Neurons[0],TrainInputsize))
|
276
304
|
ws = LayerCount - 1
|
277
305
|
for w in range(ws):
|
278
306
|
W[w + 1] = np.ones((Neurons[w + 1],Neurons[w]))
|
@@ -390,8 +418,8 @@ def SynapticDividing(
|
|
390
418
|
def Fex(
|
391
419
|
Input, # list[num]: Input data.
|
392
420
|
w, # list[list[num]]: Weight matrix of the neural network.
|
393
|
-
|
394
|
-
|
421
|
+
MembranThreshold, # str: Sign for threshold comparison ('<', '>', '==', '!=').
|
422
|
+
MembranPotential # num: Threshold value for comparison.
|
395
423
|
) -> tuple:
|
396
424
|
"""
|
397
425
|
Applies feature extraction process to the input data using synaptic pruning.
|
@@ -399,21 +427,21 @@ def Fex(
|
|
399
427
|
Args:
|
400
428
|
Input (list[num]): Input data.
|
401
429
|
w (list[list[num]]): Weight matrix of the neural network.
|
402
|
-
|
403
|
-
|
430
|
+
MembranThreshold (str): Sign for threshold comparison ('<', '>', '==', '!=').
|
431
|
+
MembranPotential (num): Threshold value for comparison.
|
404
432
|
|
405
433
|
Returns:
|
406
434
|
tuple: A tuple (vector) containing the neural layer result and the updated weight matrix.
|
407
435
|
"""
|
408
436
|
|
409
|
-
if
|
410
|
-
PruneIndex = np.where(Input <
|
411
|
-
elif
|
412
|
-
PruneIndex = np.where(Input >
|
413
|
-
elif
|
414
|
-
PruneIndex = np.where(Input ==
|
415
|
-
elif
|
416
|
-
PruneIndex = np.where(Input !=
|
437
|
+
if MembranThreshold == '<':
|
438
|
+
PruneIndex = np.where(Input < MembranPotential)
|
439
|
+
elif MembranThreshold == '>':
|
440
|
+
PruneIndex = np.where(Input > MembranPotential)
|
441
|
+
elif MembranThreshold == '==':
|
442
|
+
PruneIndex = np.where(Input == MembranPotential)
|
443
|
+
elif MembranThreshold == '!=':
|
444
|
+
PruneIndex = np.where(Input != MembranPotential)
|
417
445
|
|
418
446
|
w = SynapticPruning(w, PruneIndex, 'col', 0, 0)
|
419
447
|
|
@@ -423,8 +451,8 @@ def Fex(
|
|
423
451
|
def Cat(
|
424
452
|
Input, # list[num]: Input data.
|
425
453
|
w, # list[list[num]]: Weight matrix of the neural network.
|
426
|
-
|
427
|
-
|
454
|
+
MembranThreshold, # str: Sign for threshold comparison ('<', '>', '==', '!=').
|
455
|
+
MembranPotential, # num: Threshold value for comparison.
|
428
456
|
isTrain # int: Flag indicating if the function is called during training (1 for training, 0 otherwise).
|
429
457
|
) -> tuple:
|
430
458
|
"""
|
@@ -433,23 +461,23 @@ def Cat(
|
|
433
461
|
Args:
|
434
462
|
Input (list[num]): Input data.
|
435
463
|
w (list[list[num]]): Weight matrix of the neural network.
|
436
|
-
|
437
|
-
|
464
|
+
MembranThreshold (str): Sign for threshold comparison ('<', '>', '==', '!=').
|
465
|
+
MembranPotential (num): Threshold value for comparison.
|
438
466
|
isTrain (int): Flag indicating if the function is called during training (1 for training, 0 otherwise).
|
439
467
|
|
440
468
|
Returns:
|
441
469
|
tuple: A tuple containing the neural layer (vector) result and the possibly updated weight matrix.
|
442
470
|
"""
|
443
471
|
|
444
|
-
if
|
445
|
-
PruneIndex = np.where(Input <
|
446
|
-
elif
|
447
|
-
PruneIndex = np.where(Input >
|
448
|
-
elif
|
449
|
-
PruneIndex = np.where(Input ==
|
450
|
-
elif
|
451
|
-
PruneIndex = np.where(Input !=
|
452
|
-
if isTrain == 1 and
|
472
|
+
if MembranThreshold == '<':
|
473
|
+
PruneIndex = np.where(Input < MembranPotential)
|
474
|
+
elif MembranThreshold == '>':
|
475
|
+
PruneIndex = np.where(Input > MembranPotential)
|
476
|
+
elif MembranThreshold == '==':
|
477
|
+
PruneIndex = np.where(Input == MembranPotential)
|
478
|
+
elif MembranThreshold == '!=':
|
479
|
+
PruneIndex = np.where(Input != MembranPotential)
|
480
|
+
if isTrain == 1 and MembranThreshold != 'none':
|
453
481
|
|
454
482
|
w = SynapticPruning(w, PruneIndex, 'col', 0, 0)
|
455
483
|
|
@@ -493,19 +521,8 @@ def Softmax(
|
|
493
521
|
Returns:
|
494
522
|
list[num]: Transformed data after applying softmax function.
|
495
523
|
"""
|
496
|
-
|
497
|
-
|
498
|
-
MaxX = np.max(x)
|
499
|
-
|
500
|
-
x -= MaxX
|
501
|
-
|
502
|
-
ExpX = np.exp(x)
|
503
|
-
|
504
|
-
SumExpX = np.sum(ExpX)
|
505
524
|
|
506
|
-
|
507
|
-
|
508
|
-
return SoftmaxX
|
525
|
+
return softmax(x)
|
509
526
|
|
510
527
|
|
511
528
|
def Sigmoid(
|
@@ -520,18 +537,7 @@ def Sigmoid(
|
|
520
537
|
Returns:
|
521
538
|
list[num]: Transformed data after applying sigmoid function.
|
522
539
|
"""
|
523
|
-
|
524
|
-
PositiveMask = x >= 0
|
525
|
-
NegativeMask = ~PositiveMask
|
526
|
-
|
527
|
-
ExpXPositive = np.exp(-np.clip(x[PositiveMask], -709, None))
|
528
|
-
ExpXNegative = np.exp(np.clip(x[NegativeMask], None, 709))
|
529
|
-
|
530
|
-
SigmoidX = np.zeros_like(x, dtype=float)
|
531
|
-
SigmoidX[PositiveMask] = 1 / (1 + ExpXPositive)
|
532
|
-
SigmoidX[NegativeMask] = ExpXNegative / (1 + ExpXNegative)
|
533
|
-
|
534
|
-
return SigmoidX
|
540
|
+
return expit(x)
|
535
541
|
|
536
542
|
|
537
543
|
def Relu(
|
@@ -555,10 +561,11 @@ def TestPLAN(
|
|
555
561
|
TestInputs, # list[list[num]]: Test input data.
|
556
562
|
TestLabels, # list[num]: Test labels.
|
557
563
|
Layers, # list[str]: List of layer names.
|
558
|
-
|
559
|
-
|
564
|
+
MembranThresholds, # list[str]: List of MEMBRAN THRESHOLDS for each layer.
|
565
|
+
MembranPotentials, # list[num]: List of MEMBRAN POTENTIALS for each layer.
|
560
566
|
Normalizations, # str: Whether normalization will be performed ("y" or "n").
|
561
|
-
|
567
|
+
Activations, # str: Activation function list for the neural network.
|
568
|
+
Visualize, # Visualize Testing procces or not visualize ('y' or 'n')
|
562
569
|
W # list[list[num]]: Weight matrix of the neural network.
|
563
570
|
) -> tuple:
|
564
571
|
infoTestModel = """
|
@@ -568,8 +575,8 @@ def TestPLAN(
|
|
568
575
|
TestInputs (list[list[num]]): Test input data.
|
569
576
|
TestLabels (list[num]): Test labels.
|
570
577
|
Layers (list[str]): List of layer names.
|
571
|
-
|
572
|
-
|
578
|
+
MembranThresholds (list[str]): List of MEMBRAN THRESHOLDS for each layer.
|
579
|
+
MembranPotentials (list[num]): List of MEMBRAN POTENTIALS for each layer.
|
573
580
|
Normalizatios list([str]): Whether normalization will be performed ("yes" or "no").
|
574
581
|
Activation (str): Activation function for the neural network.
|
575
582
|
W (list[list[num]]): Weight matrix of the neural network.
|
@@ -582,7 +589,7 @@ def TestPLAN(
|
|
582
589
|
try:
|
583
590
|
Wc = [0] * len(W)
|
584
591
|
true = 0
|
585
|
-
TestPredictions = [
|
592
|
+
TestPredictions = [None] * len(TestLabels)
|
586
593
|
for i, w in enumerate(W):
|
587
594
|
Wc[i] = np.copy(w)
|
588
595
|
print('\rCopying weights.....',i+1,'/',len(W),end = "")
|
@@ -598,17 +605,17 @@ def TestPLAN(
|
|
598
605
|
for index, Layer in enumerate(Layers):
|
599
606
|
if Normalizations[index] == 'y':
|
600
607
|
NeuralLayer = Normalization(NeuralLayer)
|
601
|
-
if
|
608
|
+
if Activations[index] == 'relu':
|
602
609
|
NeuralLayer = Relu(NeuralLayer)
|
603
|
-
elif
|
610
|
+
elif Activations[index] == 'sigmoid':
|
604
611
|
NeuralLayer = Sigmoid(NeuralLayer)
|
605
|
-
elif
|
612
|
+
elif Activations[index] == 'softmax':
|
606
613
|
NeuralLayer = Softmax(NeuralLayer)
|
607
614
|
|
608
615
|
if Layers[index] == 'fex':
|
609
|
-
NeuralLayer,useless = Fex(NeuralLayer, W[index],
|
616
|
+
NeuralLayer,useless = Fex(NeuralLayer, W[index], MembranThresholds[index], MembranPotentials[index])
|
610
617
|
if Layers[index] == 'cat':
|
611
|
-
NeuralLayer,useless = Cat(NeuralLayer, W[index],
|
618
|
+
NeuralLayer,useless = Cat(NeuralLayer, W[index], MembranThresholds[index], MembranPotentials[index],0)
|
612
619
|
for i, w in enumerate(Wc):
|
613
620
|
W[i] = np.copy(w)
|
614
621
|
RealOutput = np.argmax(TestLabels[inpIndex])
|
@@ -616,7 +623,26 @@ def TestPLAN(
|
|
616
623
|
if RealOutput == PredictedOutput:
|
617
624
|
true += 1
|
618
625
|
Acc = true / len(TestLabels)
|
619
|
-
TestPredictions[inpIndex] = PredictedOutput
|
626
|
+
TestPredictions[inpIndex] = PredictedOutput
|
627
|
+
|
628
|
+
if Visualize == 'y':
|
629
|
+
|
630
|
+
TestLabelsVisual = np.copy(TestLabels)
|
631
|
+
TestLabelsVisual = np.argmax(TestLabelsVisual, axis=1)
|
632
|
+
|
633
|
+
plt.figure(figsize=(12, 6))
|
634
|
+
sns.kdeplot(TestLabelsVisual, label='Real Outputs', shade=True)
|
635
|
+
sns.kdeplot(TestPredictions, label='Predictions', shade=True)
|
636
|
+
plt.legend()
|
637
|
+
plt.xlabel('Class')
|
638
|
+
plt.ylabel('Data size')
|
639
|
+
plt.title('Predictions and Real Outputs for Testing KDE Plot')
|
640
|
+
plt.show()
|
641
|
+
|
642
|
+
if inpIndex + 1 != len(TestInputs):
|
643
|
+
|
644
|
+
plt.close('all')
|
645
|
+
|
620
646
|
UniEndTime = time.time()
|
621
647
|
|
622
648
|
CalculatingEst = round((UniEndTime - UniStartTime) * (len(TestInputs) - inpIndex),3)
|
@@ -661,24 +687,24 @@ def TestPLAN(
|
|
661
687
|
|
662
688
|
except:
|
663
689
|
|
664
|
-
print(Fore.RED + "ERROR: Testing model parameters like 'Layers' '
|
690
|
+
print(Fore.RED + "ERROR: Testing model parameters like 'Layers' 'MembranCounts' must be same as trained model. Check parameters. Are you sure weights are loaded ? from: TestPLAN" + infoTestModel + Style.RESET_ALL)
|
665
691
|
return 'e'
|
666
692
|
|
667
|
-
return TestPredictions,Acc
|
693
|
+
return W,TestPredictions,Acc
|
668
694
|
|
669
695
|
def SavePLAN(ModelName,
|
670
696
|
ModelType,
|
671
697
|
Layers,
|
672
698
|
ClassCount,
|
673
|
-
|
674
|
-
|
699
|
+
MembranThresholds,
|
700
|
+
MembranPotentials,
|
675
701
|
Normalizations,
|
676
702
|
Activations,
|
677
703
|
TestAcc,
|
678
704
|
LogType,
|
679
705
|
WeightsType,
|
680
|
-
|
681
|
-
|
706
|
+
WeightsFormat,
|
707
|
+
ModelPath,
|
682
708
|
W
|
683
709
|
):
|
684
710
|
|
@@ -690,15 +716,15 @@ def SavePLAN(ModelName,
|
|
690
716
|
ModelType (str): Type of the model.(options: PLAN)
|
691
717
|
Layers (list): List containing 'fex' and 'cat' layers.
|
692
718
|
ClassCount (int): Number of classes.
|
693
|
-
|
694
|
-
|
719
|
+
MembranThresholds (list): List containing MEMBRAN THRESHOLDS.
|
720
|
+
MembranPotentials (list): List containing MEMBRAN POTENTIALS.
|
695
721
|
DoNormalization (str): is that normalized data ? 'y' or 'n'.
|
696
722
|
Activations (list): List containing activation functions for each layer.
|
697
723
|
TestAcc (float): Test accuracy of the model.
|
698
724
|
LogType (str): Type of log to save (options: 'csv', 'txt', 'hdf5').
|
699
725
|
WeightsType (str): Type of weights to save (options: 'txt', 'npy', 'mat').
|
700
726
|
WeightFormat (str): Format of the weights (options: 'd', 'f', 'raw').
|
701
|
-
|
727
|
+
ModelPath (str): Path where the model will be saved. For example: C:/Users/beydili/Desktop/denemePLAN/
|
702
728
|
W: Weights of the model.
|
703
729
|
|
704
730
|
Returns:
|
@@ -716,7 +742,7 @@ def SavePLAN(ModelName,
|
|
716
742
|
print(Fore.RED + "ERROR110: Save Weight type (File Extension) Type must be 'txt' or 'npy' or 'mat' from: SavePLAN" + infoSavePLAN + Style.RESET_ALL)
|
717
743
|
return 'e'
|
718
744
|
|
719
|
-
if
|
745
|
+
if WeightsFormat != 'd' and WeightsFormat != 'f' and WeightsFormat != 'raw':
|
720
746
|
print(Fore.RED + "ERROR111: Weight Format Type must be 'd' or 'f' or 'raw' from: SavePLAN" + infoSavePLAN + Style.RESET_ALL)
|
721
747
|
return 'e'
|
722
748
|
|
@@ -739,8 +765,8 @@ def SavePLAN(ModelName,
|
|
739
765
|
'LAYERS': Layers,
|
740
766
|
'LAYER COUNT': len(Layers),
|
741
767
|
'CLASS COUNT': ClassCount,
|
742
|
-
'
|
743
|
-
'
|
768
|
+
'MEMBRAN THRESHOLDS': MembranThresholds,
|
769
|
+
'MEMBRAN POTENTIALS': MembranPotentials,
|
744
770
|
'NORMALIZATION': Normalizations,
|
745
771
|
'ACTIVATIONS': Activations,
|
746
772
|
'NEURON COUNT': NeuronCount,
|
@@ -748,8 +774,8 @@ def SavePLAN(ModelName,
|
|
748
774
|
'TEST ACCURACY': TestAcc,
|
749
775
|
'SAVE DATE': datetime.now(),
|
750
776
|
'WEIGHTS TYPE': WeightsType,
|
751
|
-
'WEIGHTS FORMAT':
|
752
|
-
'
|
777
|
+
'WEIGHTS FORMAT': WeightsFormat,
|
778
|
+
'MODEL PATH': ModelPath
|
753
779
|
}
|
754
780
|
try:
|
755
781
|
|
@@ -757,77 +783,77 @@ def SavePLAN(ModelName,
|
|
757
783
|
|
758
784
|
if LogType == 'csv':
|
759
785
|
|
760
|
-
df.to_csv(
|
786
|
+
df.to_csv(ModelPath + ModelName + '.csv', sep='\t', index=False)
|
761
787
|
|
762
788
|
elif LogType == 'txt':
|
763
789
|
|
764
|
-
df.to_csv(
|
790
|
+
df.to_csv(ModelPath + ModelName + '.txt', sep='\t', index=False)
|
765
791
|
|
766
792
|
elif LogType == 'hdf5':
|
767
793
|
|
768
|
-
df.to_hdf(
|
794
|
+
df.to_hdf(ModelPath + ModelName + '.h5', key='data', mode='w')
|
769
795
|
|
770
796
|
except:
|
771
797
|
|
772
|
-
print(Fore.RED + "ERROR: Model log not saved. Check the log parameters from: SavePLAN" + infoSavePLAN + Style.RESET_ALL)
|
798
|
+
print(Fore.RED + "ERROR: Model log not saved probably ModelPath incorrect. Check the log parameters from: SavePLAN" + infoSavePLAN + Style.RESET_ALL)
|
773
799
|
return 'e'
|
774
800
|
try:
|
775
801
|
|
776
|
-
if WeightsType == 'txt' and
|
802
|
+
if WeightsType == 'txt' and WeightsFormat == 'd':
|
777
803
|
|
778
804
|
for i, w in enumerate(W):
|
779
|
-
np.savetxt(
|
805
|
+
np.savetxt(ModelPath + ModelName + str(i+1) + 'w.txt' , w, fmt='%d')
|
780
806
|
|
781
|
-
if WeightsType == 'txt' and
|
807
|
+
if WeightsType == 'txt' and WeightsFormat == 'f':
|
782
808
|
|
783
809
|
for i, w in enumerate(W):
|
784
|
-
np.savetxt(
|
810
|
+
np.savetxt(ModelPath + ModelName + str(i+1) + 'w.txt' , w, fmt='%f')
|
785
811
|
|
786
|
-
if WeightsType == 'txt' and
|
812
|
+
if WeightsType == 'txt' and WeightsFormat == 'raw':
|
787
813
|
|
788
814
|
for i, w in enumerate(W):
|
789
|
-
np.savetxt(
|
815
|
+
np.savetxt(ModelPath + ModelName + str(i+1) + 'w.txt' , w)
|
790
816
|
|
791
817
|
|
792
818
|
###
|
793
819
|
|
794
820
|
|
795
|
-
if WeightsType == 'npy' and
|
821
|
+
if WeightsType == 'npy' and WeightsFormat == 'd':
|
796
822
|
|
797
823
|
for i, w in enumerate(W):
|
798
|
-
np.save(
|
824
|
+
np.save(ModelPath + ModelName + str(i+1) + 'w.npy', w.astype(int))
|
799
825
|
|
800
|
-
if WeightsType == 'npy' and
|
826
|
+
if WeightsType == 'npy' and WeightsFormat == 'f':
|
801
827
|
|
802
828
|
for i, w in enumerate(W):
|
803
|
-
np.save(
|
829
|
+
np.save(ModelPath + ModelName + str(i+1) + 'w.npy' , w, w.astype(float))
|
804
830
|
|
805
|
-
if WeightsType == 'npy' and
|
831
|
+
if WeightsType == 'npy' and WeightsFormat == 'raw':
|
806
832
|
|
807
833
|
for i, w in enumerate(W):
|
808
|
-
np.save(
|
834
|
+
np.save(ModelPath + ModelName + str(i+1) + 'w.npy' , w)
|
809
835
|
|
810
836
|
|
811
837
|
###
|
812
838
|
|
813
839
|
|
814
|
-
if WeightsType == 'mat' and
|
840
|
+
if WeightsType == 'mat' and WeightsFormat == 'd':
|
815
841
|
|
816
842
|
for i, w in enumerate(W):
|
817
843
|
w = {'w': w.astype(int)}
|
818
|
-
io.savemat(
|
844
|
+
io.savemat(ModelPath + ModelName + str(i+1) + 'w.mat', w)
|
819
845
|
|
820
|
-
if WeightsType == 'mat' and
|
846
|
+
if WeightsType == 'mat' and WeightsFormat == 'f':
|
821
847
|
|
822
848
|
for i, w in enumerate(W):
|
823
849
|
w = {'w': w.astype(float)}
|
824
|
-
io.savemat(
|
850
|
+
io.savemat(ModelPath + ModelName + str(i+1) + 'w.mat', w)
|
825
851
|
|
826
|
-
if WeightsType == 'mat' and
|
852
|
+
if WeightsType == 'mat' and WeightsFormat == 'raw':
|
827
853
|
|
828
854
|
for i, w in enumerate(W):
|
829
855
|
w = {'w': w}
|
830
|
-
io.savemat(
|
856
|
+
io.savemat(ModelPath + ModelName + str(i+1) + 'w.mat', w)
|
831
857
|
|
832
858
|
except:
|
833
859
|
|
@@ -844,7 +870,7 @@ def SavePLAN(ModelName,
|
|
844
870
|
|
845
871
|
|
846
872
|
def LoadPLAN(ModelName,
|
847
|
-
|
873
|
+
ModelPath,
|
848
874
|
LogType,
|
849
875
|
):
|
850
876
|
infoLoadPLAN = """
|
@@ -852,11 +878,11 @@ def LoadPLAN(ModelName,
|
|
852
878
|
|
853
879
|
Arguments:
|
854
880
|
ModelName (str): Name of the model.
|
855
|
-
|
881
|
+
ModelPath (str): Path where the model is saved.
|
856
882
|
LogType (str): Type of log to load (options: 'csv', 'txt', 'hdf5').
|
857
883
|
|
858
884
|
Returns:
|
859
|
-
lists: W(list[num]), Layers,
|
885
|
+
lists: W(list[num]), Layers, MembranThresholds, MembranPotentials, Normalization,Activations
|
860
886
|
"""
|
861
887
|
pass
|
862
888
|
|
@@ -867,15 +893,15 @@ def LoadPLAN(ModelName,
|
|
867
893
|
try:
|
868
894
|
|
869
895
|
if LogType == 'csv':
|
870
|
-
df = pd.read_csv(
|
896
|
+
df = pd.read_csv(ModelPath + ModelName + '.' + LogType)
|
871
897
|
|
872
898
|
|
873
899
|
if LogType == 'txt':
|
874
|
-
df = pd.read_csv(
|
900
|
+
df = pd.read_csv(ModelPath + ModelName + '.' + LogType, delimiter='\t')
|
875
901
|
|
876
902
|
|
877
903
|
if LogType == 'hdf5':
|
878
|
-
df = pd.read_hdf(
|
904
|
+
df = pd.read_hdf(ModelPath + ModelName + '.' + LogType)
|
879
905
|
except:
|
880
906
|
print(Fore.RED + "ERROR: Model Path error. Accaptable form: 'C:/Users/hasancanbeydili/Desktop/denemePLAN/' from: LoadPLAN" + infoLoadPLAN + Style.RESET_ALL)
|
881
907
|
|
@@ -883,9 +909,9 @@ def LoadPLAN(ModelName,
|
|
883
909
|
Layers = df['LAYERS'].tolist()
|
884
910
|
LayerCount = int(df['LAYER COUNT'].iloc[0])
|
885
911
|
ClassCount = int(df['CLASS COUNT'].iloc[0])
|
886
|
-
|
887
|
-
|
888
|
-
|
912
|
+
MembranThresholds = df['MEMBRAN THRESHOLDS'].tolist()
|
913
|
+
MembranPotentials = df['MEMBRAN POTENTIALS'].tolist()
|
914
|
+
Normalizations = df['NORMALIZATION'].tolist()
|
889
915
|
Activations = df['ACTIVATIONS'].tolist()
|
890
916
|
NeuronCount = int(df['NEURON COUNT'].iloc[0])
|
891
917
|
SynapseCount = int(df['SYNAPSE COUNT'].iloc[0])
|
@@ -893,23 +919,23 @@ def LoadPLAN(ModelName,
|
|
893
919
|
ModelType = str(df['MODEL TYPE'].iloc[0])
|
894
920
|
WeightType = str(df['WEIGHTS TYPE'].iloc[0])
|
895
921
|
WeightFormat = str(df['WEIGHTS FORMAT'].iloc[0])
|
896
|
-
|
922
|
+
ModelPath = str(df['MODEL PATH'].iloc[0])
|
897
923
|
|
898
924
|
W = [0] * LayerCount
|
899
925
|
|
900
926
|
if WeightType == 'txt':
|
901
|
-
for i in range(LayerCount):
|
902
|
-
W[i] = np.loadtxt(
|
927
|
+
for i in range(LayerCount):
|
928
|
+
W[i] = np.loadtxt(ModelPath + ModelName + str(i+1) + 'w.txt')
|
903
929
|
elif WeightType == 'npy':
|
904
930
|
for i in range(LayerCount):
|
905
|
-
W[i] = np.load(
|
931
|
+
W[i] = np.load(ModelPath + ModelName + str(i+1) + 'w.npy')
|
906
932
|
elif WeightType == 'mat':
|
907
933
|
for i in range(LayerCount):
|
908
|
-
W[i] = sio.loadmat(
|
934
|
+
W[i] = sio.loadmat(ModelPath + ModelName + str(i+1) + 'w.mat')
|
909
935
|
else:
|
910
936
|
raise ValueError(Fore.RED + "Incorrect weight type value. Value must be 'txt', 'npy' or 'mat' from: LoadPLAN." + infoLoadPLAN + Style.RESET_ALL)
|
911
937
|
print(Fore.GREEN + "Model loaded succesfully" + Style.RESET_ALL)
|
912
|
-
return W,Layers,
|
938
|
+
return W,Layers,MembranThresholds,MembranPotentials,Normalizations,Activations,df
|
913
939
|
|
914
940
|
def PredictFromDiscPLAN(Input,ModelName,ModelPath,LogType):
|
915
941
|
infoPredictFromDİscPLAN = """
|
@@ -924,7 +950,7 @@ def PredictFromDiscPLAN(Input,ModelName,ModelPath,LogType):
|
|
924
950
|
Returns:
|
925
951
|
ndarray: Output from the model.
|
926
952
|
"""
|
927
|
-
W,Layers,
|
953
|
+
W,Layers,MembranThresholds,MembranPotentials,Normalizations,Activations = LoadPLAN(ModelName,ModelPath,
|
928
954
|
LogType)[0:6]
|
929
955
|
Wc = [0] * len(W)
|
930
956
|
for i, w in enumerate(W):
|
@@ -945,12 +971,12 @@ def PredictFromDiscPLAN(Input,ModelName,ModelPath,LogType):
|
|
945
971
|
|
946
972
|
if Layers[index] == 'fex':
|
947
973
|
NeuralLayer,useless = Fex(NeuralLayer, W[index],
|
948
|
-
|
949
|
-
|
974
|
+
MembranThresholds[index],
|
975
|
+
MembranPotentials[index])
|
950
976
|
if Layers[index] == 'cat':
|
951
977
|
NeuralLayer,useless = Cat(NeuralLayer, W[index],
|
952
|
-
|
953
|
-
|
978
|
+
MembranThresholds[index],
|
979
|
+
MembranPotentials[index],
|
954
980
|
0)
|
955
981
|
except:
|
956
982
|
print(Fore.RED + "ERROR: The input was probably entered incorrectly. from: PredictFromDiscPLAN" + infoPredictFromDİscPLAN + Style.RESET_ALL)
|
@@ -960,7 +986,7 @@ def PredictFromDiscPLAN(Input,ModelName,ModelPath,LogType):
|
|
960
986
|
return NeuralLayer
|
961
987
|
|
962
988
|
|
963
|
-
def PredictFromRamPLAN(Input,Layers,
|
989
|
+
def PredictFromRamPLAN(Input,Layers,MembranThresholds,MembranPotentials,Normalizations,Activations,W):
|
964
990
|
infoPredictFromRamPLAN = """
|
965
991
|
Function to make a prediction using a pruning learning artificial neural network (PLAN)
|
966
992
|
from weights and parameters stored in memory.
|
@@ -968,8 +994,8 @@ def PredictFromRamPLAN(Input,Layers,ThresholdSigns,ThresholdValues,Normalization
|
|
968
994
|
Arguments:
|
969
995
|
Input (list or ndarray): Input data for the model (single vector or single matrix).
|
970
996
|
Layers (list): Number and types of layers.
|
971
|
-
|
972
|
-
|
997
|
+
MembranThresholds (list): MEMBRAN THRESHOLDS.
|
998
|
+
MembranPotentials (list): MEMBRAN POTENTIALS.
|
973
999
|
DoNormalization (str): Whether to normalize ('y' or 'n').
|
974
1000
|
Activations (list): Activation functions for each layer.
|
975
1001
|
W (list of ndarrays): Weights of the model.
|
@@ -997,12 +1023,12 @@ def PredictFromRamPLAN(Input,Layers,ThresholdSigns,ThresholdValues,Normalization
|
|
997
1023
|
|
998
1024
|
if Layers[index] == 'fex':
|
999
1025
|
NeuralLayer,useless = Fex(NeuralLayer, W[index],
|
1000
|
-
|
1001
|
-
|
1026
|
+
MembranThresholds[index],
|
1027
|
+
MembranPotentials[index])
|
1002
1028
|
if Layers[index] == 'cat':
|
1003
1029
|
NeuralLayer,useless = Cat(NeuralLayer, W[index],
|
1004
|
-
|
1005
|
-
|
1030
|
+
MembranThresholds[index],
|
1031
|
+
MembranPotentials[index],0)
|
1006
1032
|
except:
|
1007
1033
|
print(Fore.RED + "ERROR: Unexpected input or wrong model parameters from: PredictFromRamPLAN." + infoPredictFromRamPLAN + Style.RESET_ALL)
|
1008
1034
|
return 'e'
|
@@ -1029,7 +1055,6 @@ def AutoBalancer(TrainInputs, TrainLabels, ClassCount):
|
|
1029
1055
|
|
1030
1056
|
if len(set(ClassCounts)) == 1:
|
1031
1057
|
print(Fore.WHITE + "INFO: All training data have already balanced. from: AutoBalancer" + Style.RESET_ALL)
|
1032
|
-
time.sleep(1.5)
|
1033
1058
|
return TrainInputs, TrainLabels
|
1034
1059
|
|
1035
1060
|
MinCount = min(ClassCounts)
|
@@ -1046,9 +1071,25 @@ def AutoBalancer(TrainInputs, TrainLabels, ClassCount):
|
|
1046
1071
|
BalancedLabels = [TrainLabels[idx] for idx in BalancedIndices]
|
1047
1072
|
|
1048
1073
|
print(Fore.GREEN + "All Training Data Succesfully Balanced from: " + str(len(TrainInputs)) + " to: " + str(len(BalancedInputs)) + ". from: AutoBalancer " + Style.RESET_ALL)
|
1049
|
-
time.sleep(1.5)
|
1050
1074
|
except:
|
1051
1075
|
print(Fore.RED + "ERROR: Inputs and labels must be same length check parameters" + infoAutoBalancer)
|
1052
1076
|
return 'e'
|
1053
1077
|
|
1054
|
-
return BalancedInputs, BalancedLabels
|
1078
|
+
return BalancedInputs, BalancedLabels
|
1079
|
+
|
1080
|
+
|
1081
|
+
def GetWeights():
|
1082
|
+
|
1083
|
+
return 0
|
1084
|
+
|
1085
|
+
def GetDf():
|
1086
|
+
|
1087
|
+
return 6
|
1088
|
+
|
1089
|
+
def GetPreds():
|
1090
|
+
|
1091
|
+
return 1
|
1092
|
+
|
1093
|
+
def GetAcc():
|
1094
|
+
|
1095
|
+
return 2
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: pyerualjetwork
|
3
|
+
Version: 1.2.9
|
4
|
+
Summary: Advanced python deep learning library. New Visualize parameter added ('y' or 'n') for TrainPlan and TestPLAN funcs. (Documentation in desc. Examples in GİTHUB: https://github.com/HCB06/PyerualJetwork)
|
5
|
+
Author: Hasan Can Beydili
|
6
|
+
Author-email: tchasancan@gmail.com
|
7
|
+
Keywords: model evaluation,classifcation,pruning learning artficial neural networks
|
8
|
+
Requires-Dist: numpy
|
9
|
+
Requires-Dist: scipy
|
10
|
+
Requires-Dist: time
|
11
|
+
Requires-Dist: math
|
12
|
+
Requires-Dist: colorama
|
13
|
+
Requires-Dist: typing
|
14
|
+
Provides-Extra: visualization
|
15
|
+
Requires-Dist: matplotlib ; extra == 'visualization'
|
16
|
+
Requires-Dist: seaborn ; extra == 'visualization'
|
17
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
plan/__init__.py,sha256=4trwhtGaeJd2tncziQAKrPT-Jjz6Q8nBG0n3SlyH1a4,352
|
2
|
+
plan/plan.py,sha256=GVJdUx0F1C-h5MJAVXTvWvgHzzS0Gs8ze28E6uXMnH4,42347
|
3
|
+
pyerualjetwork-1.2.9.dist-info/METADATA,sha256=M6KntwKkuqtaDM2RWwhFXF2chklxSi99kWKeu9R7zTU,693
|
4
|
+
pyerualjetwork-1.2.9.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
5
|
+
pyerualjetwork-1.2.9.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
6
|
+
pyerualjetwork-1.2.9.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: pyerualjetwork
|
3
|
-
Version: 1.1.7
|
4
|
-
Summary: Advanced python deep learning library.(More document coming soon..)
|
5
|
-
Author: Hasan Can Beydili
|
6
|
-
Author-email: tchasancan@gmail.com
|
7
|
-
Keywords: model evaluation,classifcation,divided pruning neural networks
|
8
|
-
|
@@ -1,6 +0,0 @@
|
|
1
|
-
plan/__init__.py,sha256=cyb3DkUey_4zEApoFtf-UBMGwd8uFADSjy3osQUG_pY,315
|
2
|
-
plan/plan.py,sha256=Se6dR8-BEAoBOzb-Tx-FhsBWuGuniZrRYczXo5mnj7o,40264
|
3
|
-
pyerualjetwork-1.1.7.dist-info/METADATA,sha256=bfMD1E-CQXvtiGcAb-Og63ZyAoGfpULVdDlaRCnuRA4,278
|
4
|
-
pyerualjetwork-1.1.7.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
5
|
-
pyerualjetwork-1.1.7.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
6
|
-
pyerualjetwork-1.1.7.dist-info/RECORD,,
|
File without changes
|