pyerualjetwork 2.4.9__py3-none-any.whl → 2.5.1__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 +45 -31
- {pyerualjetwork-2.4.9.dist-info → pyerualjetwork-2.5.1.dist-info}/METADATA +1 -1
- pyerualjetwork-2.5.1.dist-info/RECORD +6 -0
- pyerualjetwork-2.4.9.dist-info/RECORD +0 -6
- {pyerualjetwork-2.4.9.dist-info → pyerualjetwork-2.5.1.dist-info}/WHEEL +0 -0
- {pyerualjetwork-2.4.9.dist-info → pyerualjetwork-2.5.1.dist-info}/top_level.txt +0 -0
plan/plan.py
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
|
1
4
|
|
2
5
|
"""
|
3
6
|
Created on Thu Jun 12 00:00:00 2024
|
@@ -854,17 +857,26 @@ def predict_model_ssd(Input, model_name, model_path):
|
|
854
857
|
ndarray: Output from the model.
|
855
858
|
"""
|
856
859
|
W, df = load_model(model_name, model_path)
|
857
|
-
|
858
|
-
scaler_params = str(df['STANDARD SCALER'].iloc[0])
|
859
|
-
activation_potential = str(df['ACTIVATION POTENTIAL'].iloc[0])
|
860
860
|
|
861
|
-
|
862
|
-
|
861
|
+
activation_potential = str(df['ACTIVATION POTENTIAL'].iloc[0])
|
862
|
+
|
863
|
+
if activation_potential != 'nan':
|
864
|
+
|
863
865
|
activation_potential = float(activation_potential)
|
866
|
+
|
867
|
+
try:
|
864
868
|
|
865
|
-
|
869
|
+
scaler_params = df['STANDARD SCALER'].tolist()
|
870
|
+
|
871
|
+
|
872
|
+
scaler_params = [np.fromstring(arr.strip('[]'), sep=' ') for arr in scaler_params]
|
866
873
|
|
867
874
|
Input = standard_scaler(None, Input, scaler_params)
|
875
|
+
|
876
|
+
except:
|
877
|
+
|
878
|
+
non_scaled = True
|
879
|
+
|
868
880
|
|
869
881
|
layers = ['fex', 'cat']
|
870
882
|
|
@@ -907,7 +919,7 @@ def predict_model_ram(Input, scaler_params, W, activation_potential=None):
|
|
907
919
|
Returns:
|
908
920
|
ndarray: Output from the model.
|
909
921
|
"""
|
910
|
-
|
922
|
+
|
911
923
|
if scaler_params != None:
|
912
924
|
|
913
925
|
Input = standard_scaler(None, Input, scaler_params)
|
@@ -1055,35 +1067,37 @@ def standard_scaler(x_train, x_test, scaler_params=None):
|
|
1055
1067
|
"""
|
1056
1068
|
try:
|
1057
1069
|
|
1058
|
-
|
1059
|
-
|
1060
|
-
mean = np.mean(x_train, axis=0)
|
1061
|
-
std = np.std(x_train, axis=0)
|
1062
|
-
train_data_scaled = (x_train - mean) / std
|
1063
|
-
test_data_scaled = (x_test - mean) / std
|
1064
|
-
|
1065
|
-
scaler_params = [mean, std]
|
1066
|
-
|
1067
|
-
return scaler_params, train_data_scaled, test_data_scaled
|
1070
|
+
if scaler_params == None and x_test != None:
|
1068
1071
|
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1072
|
+
mean = np.mean(x_train, axis=0)
|
1073
|
+
std = np.std(x_train, axis=0)
|
1074
|
+
train_data_scaled = (x_train - mean) / std
|
1075
|
+
test_data_scaled = (x_test - mean) / std
|
1076
|
+
|
1077
|
+
scaler_params = [mean, std]
|
1078
|
+
|
1079
|
+
return scaler_params, train_data_scaled, test_data_scaled
|
1080
|
+
|
1081
|
+
if scaler_params == None and x_test == None:
|
1082
|
+
|
1083
|
+
mean = np.mean(x_train, axis=0)
|
1084
|
+
std = np.std(x_train, axis=0)
|
1085
|
+
train_data_scaled = (x_train - mean) / std
|
1086
|
+
|
1087
|
+
scaler_params = [mean, std]
|
1088
|
+
|
1089
|
+
return scaler_params, train_data_scaled
|
1090
|
+
|
1091
|
+
if scaler_params != None:
|
1092
|
+
|
1093
|
+
test_data_scaled = (x_test - scaler_params[0]) / scaler_params[1]
|
1094
|
+
return test_data_scaled
|
1082
1095
|
|
1083
1096
|
except:
|
1084
1097
|
print(
|
1085
1098
|
Fore.RED + "ERROR: x_train and x_test must be list[numpyarray] from standard_scaler" + info_standard_scaler)
|
1086
1099
|
|
1100
|
+
|
1087
1101
|
def encode_one_hot(y_train, y_test):
|
1088
1102
|
info_one_hot_encode = """
|
1089
1103
|
Performs one-hot encoding on y_train and y_test data..
|
@@ -1563,4 +1577,4 @@ def get_preds():
|
|
1563
1577
|
|
1564
1578
|
def get_acc():
|
1565
1579
|
|
1566
|
-
return 2
|
1580
|
+
return 2
|
@@ -0,0 +1,6 @@
|
|
1
|
+
plan/__init__.py,sha256=gmaz8lnQfl18MbOQwabBUPmShajK5S99jfyY-hQe8tc,502
|
2
|
+
plan/plan.py,sha256=I-dmeXnmikB8tV4MWhaHnPgQLf1IaOZNzL1oSebPyU0,53087
|
3
|
+
pyerualjetwork-2.5.1.dist-info/METADATA,sha256=T5Si0W3NTUtPXQQ7_irJizf5K-q5E7aHqs0gy4bV04s,276
|
4
|
+
pyerualjetwork-2.5.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
5
|
+
pyerualjetwork-2.5.1.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
6
|
+
pyerualjetwork-2.5.1.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
plan/__init__.py,sha256=gmaz8lnQfl18MbOQwabBUPmShajK5S99jfyY-hQe8tc,502
|
2
|
-
plan/plan.py,sha256=vJRHBcDUPJNAE_5PGQBu0z7CiFFDXO7Cal3udtUIUAo,52965
|
3
|
-
pyerualjetwork-2.4.9.dist-info/METADATA,sha256=GS9lnkixHFWcYP1L2bxp_LaOTcEC0tFeeiEo9mXB_20,276
|
4
|
-
pyerualjetwork-2.4.9.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
5
|
-
pyerualjetwork-2.4.9.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
6
|
-
pyerualjetwork-2.4.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|