pyerualjetwork 1.1.8__py3-none-any.whl → 1.2.0__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/plan.py +19 -21
- pyerualjetwork-1.2.0.dist-info/METADATA +8 -0
- pyerualjetwork-1.2.0.dist-info/RECORD +6 -0
- pyerualjetwork-1.1.8.dist-info/METADATA +0 -8
- pyerualjetwork-1.1.8.dist-info/RECORD +0 -6
- {pyerualjetwork-1.1.8.dist-info → pyerualjetwork-1.2.0.dist-info}/WHEEL +0 -0
- {pyerualjetwork-1.1.8.dist-info → pyerualjetwork-1.2.0.dist-info}/top_level.txt +0 -0
plan/plan.py
CHANGED
@@ -31,7 +31,7 @@ def TrainPLAN(
|
|
31
31
|
Activations (list[str]): List of activation functions.
|
32
32
|
|
33
33
|
Returns:
|
34
|
-
list([num]): (Weight matrices list, TrainPredictions list
|
34
|
+
list([num]): (Weight matrices list, TrainPredictions list, TrainAcc).
|
35
35
|
error handled ?: Process status ('e')
|
36
36
|
"""
|
37
37
|
|
@@ -245,7 +245,7 @@ def TrainPLAN(
|
|
245
245
|
|
246
246
|
|
247
247
|
|
248
|
-
return TrainedWs,TrainPredictions
|
248
|
+
return TrainedWs,TrainPredictions,Acc
|
249
249
|
|
250
250
|
# FUNCTIONS -----
|
251
251
|
|
@@ -557,7 +557,7 @@ def TestPLAN(
|
|
557
557
|
ThresholdSigns, # list[str]: List of threshold signs for each layer.
|
558
558
|
ThresholdValues, # list[num]: List of threshold values for each layer.
|
559
559
|
Normalizations, # str: Whether normalization will be performed ("y" or "n").
|
560
|
-
|
560
|
+
Activations, # str: Activation function list for the neural network.
|
561
561
|
W # list[list[num]]: Weight matrix of the neural network.
|
562
562
|
) -> tuple:
|
563
563
|
infoTestModel = """
|
@@ -597,11 +597,11 @@ def TestPLAN(
|
|
597
597
|
for index, Layer in enumerate(Layers):
|
598
598
|
if Normalizations[index] == 'y':
|
599
599
|
NeuralLayer = Normalization(NeuralLayer)
|
600
|
-
if
|
600
|
+
if Activations[index] == 'relu':
|
601
601
|
NeuralLayer = Relu(NeuralLayer)
|
602
|
-
elif
|
602
|
+
elif Activations[index] == 'sigmoid':
|
603
603
|
NeuralLayer = Sigmoid(NeuralLayer)
|
604
|
-
elif
|
604
|
+
elif Activations[index] == 'softmax':
|
605
605
|
NeuralLayer = Softmax(NeuralLayer)
|
606
606
|
|
607
607
|
if Layers[index] == 'fex':
|
@@ -676,7 +676,7 @@ def SavePLAN(ModelName,
|
|
676
676
|
TestAcc,
|
677
677
|
LogType,
|
678
678
|
WeightsType,
|
679
|
-
|
679
|
+
WeightsFormat,
|
680
680
|
SavePath,
|
681
681
|
W
|
682
682
|
):
|
@@ -715,7 +715,7 @@ def SavePLAN(ModelName,
|
|
715
715
|
print(Fore.RED + "ERROR110: Save Weight type (File Extension) Type must be 'txt' or 'npy' or 'mat' from: SavePLAN" + infoSavePLAN + Style.RESET_ALL)
|
716
716
|
return 'e'
|
717
717
|
|
718
|
-
if
|
718
|
+
if WeightsFormat != 'd' and WeightsFormat != 'f' and WeightsFormat != 'raw':
|
719
719
|
print(Fore.RED + "ERROR111: Weight Format Type must be 'd' or 'f' or 'raw' from: SavePLAN" + infoSavePLAN + Style.RESET_ALL)
|
720
720
|
return 'e'
|
721
721
|
|
@@ -747,7 +747,7 @@ def SavePLAN(ModelName,
|
|
747
747
|
'TEST ACCURACY': TestAcc,
|
748
748
|
'SAVE DATE': datetime.now(),
|
749
749
|
'WEIGHTS TYPE': WeightsType,
|
750
|
-
'WEIGHTS FORMAT':
|
750
|
+
'WEIGHTS FORMAT': WeightsFormat,
|
751
751
|
'SAVE PATH': SavePath
|
752
752
|
}
|
753
753
|
try:
|
@@ -772,17 +772,17 @@ def SavePLAN(ModelName,
|
|
772
772
|
return 'e'
|
773
773
|
try:
|
774
774
|
|
775
|
-
if WeightsType == 'txt' and
|
775
|
+
if WeightsType == 'txt' and WeightsFormat == 'd':
|
776
776
|
|
777
777
|
for i, w in enumerate(W):
|
778
778
|
np.savetxt(SavePath + ModelName + str(i+1) + 'w.txt' , w, fmt='%d')
|
779
779
|
|
780
|
-
if WeightsType == 'txt' and
|
780
|
+
if WeightsType == 'txt' and WeightsFormat == 'f':
|
781
781
|
|
782
782
|
for i, w in enumerate(W):
|
783
783
|
np.savetxt(SavePath + ModelName + str(i+1) + 'w.txt' , w, fmt='%f')
|
784
784
|
|
785
|
-
if WeightsType == 'txt' and
|
785
|
+
if WeightsType == 'txt' and WeightsFormat == 'raw':
|
786
786
|
|
787
787
|
for i, w in enumerate(W):
|
788
788
|
np.savetxt(SavePath + ModelName + str(i+1) + 'w.txt' , w)
|
@@ -791,17 +791,17 @@ def SavePLAN(ModelName,
|
|
791
791
|
###
|
792
792
|
|
793
793
|
|
794
|
-
if WeightsType == 'npy' and
|
794
|
+
if WeightsType == 'npy' and WeightsFormat == 'd':
|
795
795
|
|
796
796
|
for i, w in enumerate(W):
|
797
797
|
np.save(SavePath + ModelName + str(i+1) + 'w.npy', w.astype(int))
|
798
798
|
|
799
|
-
if WeightsType == 'npy' and
|
799
|
+
if WeightsType == 'npy' and WeightsFormat == 'f':
|
800
800
|
|
801
801
|
for i, w in enumerate(W):
|
802
802
|
np.save(SavePath + ModelName + str(i+1) + 'w.npy' , w, w.astype(float))
|
803
803
|
|
804
|
-
if WeightsType == 'npy' and
|
804
|
+
if WeightsType == 'npy' and WeightsFormat == 'raw':
|
805
805
|
|
806
806
|
for i, w in enumerate(W):
|
807
807
|
np.save(SavePath + ModelName + str(i+1) + 'w.npy' , w)
|
@@ -810,19 +810,19 @@ def SavePLAN(ModelName,
|
|
810
810
|
###
|
811
811
|
|
812
812
|
|
813
|
-
if WeightsType == 'mat' and
|
813
|
+
if WeightsType == 'mat' and WeightsFormat == 'd':
|
814
814
|
|
815
815
|
for i, w in enumerate(W):
|
816
816
|
w = {'w': w.astype(int)}
|
817
817
|
io.savemat(SavePath + ModelName + str(i+1) + 'w.mat', w)
|
818
818
|
|
819
|
-
if WeightsType == 'mat' and
|
819
|
+
if WeightsType == 'mat' and WeightsFormat == 'f':
|
820
820
|
|
821
821
|
for i, w in enumerate(W):
|
822
822
|
w = {'w': w.astype(float)}
|
823
823
|
io.savemat(SavePath + ModelName + str(i+1) + 'w.mat', w)
|
824
824
|
|
825
|
-
if WeightsType == 'mat' and
|
825
|
+
if WeightsType == 'mat' and WeightsFormat == 'raw':
|
826
826
|
|
827
827
|
for i, w in enumerate(W):
|
828
828
|
w = {'w': w}
|
@@ -908,7 +908,7 @@ def LoadPLAN(ModelName,
|
|
908
908
|
else:
|
909
909
|
raise ValueError(Fore.RED + "Incorrect weight type value. Value must be 'txt', 'npy' or 'mat' from: LoadPLAN." + infoLoadPLAN + Style.RESET_ALL)
|
910
910
|
print(Fore.GREEN + "Model loaded succesfully" + Style.RESET_ALL)
|
911
|
-
return W,Layers,ThresholdSigns,ThresholdValues,
|
911
|
+
return W,Layers,ThresholdSigns,ThresholdValues,Normalizations,Activations,df
|
912
912
|
|
913
913
|
def PredictFromDiscPLAN(Input,ModelName,ModelPath,LogType):
|
914
914
|
infoPredictFromDİscPLAN = """
|
@@ -1028,7 +1028,6 @@ def AutoBalancer(TrainInputs, TrainLabels, ClassCount):
|
|
1028
1028
|
|
1029
1029
|
if len(set(ClassCounts)) == 1:
|
1030
1030
|
print(Fore.WHITE + "INFO: All training data have already balanced. from: AutoBalancer" + Style.RESET_ALL)
|
1031
|
-
time.sleep(1.5)
|
1032
1031
|
return TrainInputs, TrainLabels
|
1033
1032
|
|
1034
1033
|
MinCount = min(ClassCounts)
|
@@ -1045,7 +1044,6 @@ def AutoBalancer(TrainInputs, TrainLabels, ClassCount):
|
|
1045
1044
|
BalancedLabels = [TrainLabels[idx] for idx in BalancedIndices]
|
1046
1045
|
|
1047
1046
|
print(Fore.GREEN + "All Training Data Succesfully Balanced from: " + str(len(TrainInputs)) + " to: " + str(len(BalancedInputs)) + ". from: AutoBalancer " + Style.RESET_ALL)
|
1048
|
-
time.sleep(1.5)
|
1049
1047
|
except:
|
1050
1048
|
print(Fore.RED + "ERROR: Inputs and labels must be same length check parameters" + infoAutoBalancer)
|
1051
1049
|
return 'e'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: pyerualjetwork
|
3
|
+
Version: 1.2.0
|
4
|
+
Summary: Advanced python deep learning library.(Documentation in desc. Examples in GİTHUB: HCB06)
|
5
|
+
Author: Hasan Can Beydili
|
6
|
+
Author-email: tchasancan@gmail.com
|
7
|
+
Keywords: model evaluation,classifcation,pruning learning artficial neural networks
|
8
|
+
|
@@ -0,0 +1,6 @@
|
|
1
|
+
plan/__init__.py,sha256=cyb3DkUey_4zEApoFtf-UBMGwd8uFADSjy3osQUG_pY,315
|
2
|
+
plan/plan.py,sha256=dp-ZuhbyatgwrLDwEfEtuFWmTV-twvaFvD8TIC8FSXE,40179
|
3
|
+
pyerualjetwork-1.2.0.dist-info/METADATA,sha256=RKNNHxpHzKXhfgJ_M9VO0ln8sM076yc4H6rADoJQOJY,311
|
4
|
+
pyerualjetwork-1.2.0.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
5
|
+
pyerualjetwork-1.2.0.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
6
|
+
pyerualjetwork-1.2.0.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: pyerualjetwork
|
3
|
-
Version: 1.1.8
|
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=VtM3gyOiyGPHgiZKBo1gRbv4Bvxc4MQht_kP45he9zI,40201
|
3
|
-
pyerualjetwork-1.1.8.dist-info/METADATA,sha256=9ieJju6xGncRPGsnutPJM069CItIz2ABIxslDUIh7i0,278
|
4
|
-
pyerualjetwork-1.1.8.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
|
5
|
-
pyerualjetwork-1.1.8.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
6
|
-
pyerualjetwork-1.1.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|