pyerualjetwork 4.5.1__py3-none-any.whl → 4.5.2__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.
@@ -1,4 +1,4 @@
1
- __version__ = "4.5.1"
1
+ __version__ = "4.5.2"
2
2
  __update__ = """* Changes: https://github.com/HCB06/PyerualJetwork/blob/main/CHANGES
3
3
  * PyerualJetwork Homepage: https://github.com/HCB06/PyerualJetwork/tree/main
4
4
  * PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf
@@ -126,7 +126,7 @@ def manuel_balancer(x_train, y_train, target_samples_per_class, dtype=np.float32
126
126
  x_balanced -- Balanced input dataset (numpy array format)
127
127
  y_balanced -- Balanced class labels (one-hot encoded, numpy array format)
128
128
  """
129
- from .ui import loading_bars
129
+ from .ui import loading_bars, get_loading_bar_style
130
130
  from .memory_operations import transfer_to_cpu
131
131
 
132
132
  x_train = transfer_to_cpu(x_train, dtype=dtype)
@@ -138,7 +138,7 @@ def manuel_balancer(x_train, y_train, target_samples_per_class, dtype=np.float32
138
138
  x_balanced = []
139
139
  y_balanced = []
140
140
 
141
- for class_label in tqdm(range(class_count),leave=False, ascii="▱▰",
141
+ for class_label in tqdm(range(class_count),leave=False, ascii=get_loading_bar_style(),
142
142
  bar_format=bar_format,desc='Augmenting Data',ncols= 52):
143
143
  class_indices = np.where(np.argmax(y_train, axis=1) == class_label)[0]
144
144
  num_samples = len(class_indices)
@@ -201,7 +201,7 @@ def auto_balancer(x_train, y_train, dtype=np.float32):
201
201
  Returns:
202
202
  tuple: A tuple containing balanced input data and labels.
203
203
  """
204
- from .ui import loading_bars
204
+ from .ui import loading_bars, get_loading_bar_style
205
205
  from .memory_operations import transfer_to_cpu
206
206
 
207
207
  x_train = transfer_to_cpu(x_train, dtype=dtype)
@@ -222,7 +222,7 @@ def auto_balancer(x_train, y_train, dtype=np.float32):
222
222
  MinCount = min(classes)
223
223
 
224
224
  BalancedIndices = []
225
- for i in tqdm(range(class_count),leave=False, ascii="▱▰",
225
+ for i in tqdm(range(class_count),leave=False, ascii=get_loading_bar_style(),
226
226
  bar_format= bar_format, desc='Balancing Data',ncols=70):
227
227
  if len(ClassIndices[i]) > MinCount:
228
228
  SelectedIndices = np.random.choice(
@@ -267,7 +267,7 @@ def synthetic_augmentation(x, y, dtype=np.float32):
267
267
  Returns:
268
268
  x_train_balanced, y_train_balanced (numpy array format)
269
269
  """
270
- from .ui import loading_bars
270
+ from .ui import loading_bars, get_loading_bar_style
271
271
  from .memory_operations import transfer_to_cpu
272
272
 
273
273
  x = transfer_to_cpu(x, dtype=dtype)
@@ -286,7 +286,7 @@ def synthetic_augmentation(x, y, dtype=np.float32):
286
286
  y_balanced = list(y)
287
287
 
288
288
 
289
- for class_label in tqdm(range(class_count), leave=False, ascii="▱▰",
289
+ for class_label in tqdm(range(class_count), leave=False, ascii=get_loading_bar_style(),
290
290
  bar_format=bar_format,desc='Augmenting Data',ncols= 52):
291
291
  class_indices = [i for i, label in enumerate(
292
292
  y) if np.argmax(label) == class_label]
@@ -142,7 +142,7 @@ def manuel_balancer(x_train, y_train, target_samples_per_class, dtype=cp.float32
142
142
  x_balanced -- Balanced input dataset (cupy array format)
143
143
  y_balanced -- Balanced class labels (one-hot encoded, cupy array format)
144
144
  """
145
- from .ui import loading_bars
145
+ from .ui import loading_bars, get_loading_bar_style
146
146
  from .memory_operations import transfer_to_gpu
147
147
 
148
148
  bar_format = loading_bars()[0]
@@ -155,7 +155,7 @@ def manuel_balancer(x_train, y_train, target_samples_per_class, dtype=cp.float32
155
155
  x_balanced = []
156
156
  y_balanced = []
157
157
 
158
- for class_label in tqdm(range(class_count),leave=False, ascii="▱▰",
158
+ for class_label in tqdm(range(class_count),leave=False, ascii=get_loading_bar_style(),
159
159
  bar_format=bar_format,desc='Augmenting Data',ncols= 52):
160
160
  class_indices = cp.where(cp.argmax(y_train, axis=1) == class_label)[0]
161
161
  num_samples = len(class_indices)
@@ -231,7 +231,7 @@ def auto_balancer(x_train, y_train, dtype=cp.float32, shuffle_in_cpu=False):
231
231
  tuple: A tuple containing balanced input data and labels.
232
232
  """
233
233
 
234
- from .ui import loading_bars
234
+ from .ui import loading_bars, get_loading_bar_style
235
235
  from .memory_operations import transfer_to_gpu
236
236
 
237
237
  x_train = transfer_to_gpu(x_train, dtype=dtype)
@@ -254,7 +254,7 @@ def auto_balancer(x_train, y_train, dtype=cp.float32, shuffle_in_cpu=False):
254
254
  MinCount = min(classes)
255
255
 
256
256
  BalancedIndices = []
257
- for i in tqdm(range(class_count),leave=False, ascii="▱▰",
257
+ for i in tqdm(range(class_count),leave=False, ascii=get_loading_bar_style(),
258
258
  bar_format= bar_format, desc='Balancing Data',ncols=70):
259
259
  if len(ClassIndices[i]) > MinCount:
260
260
  if shuffle_in_cpu:
@@ -301,7 +301,7 @@ def synthetic_augmentation(x_train, y_train, dtype=cp.float32, shuffle_in_cpu=Fa
301
301
  Returns:
302
302
  x_train_balanced, y_train_balanced (cupy array format)
303
303
  """
304
- from .ui import loading_bars
304
+ from .ui import loading_bars, get_loading_bar_style
305
305
  from .memory_operations import transfer_to_gpu
306
306
 
307
307
  x = transfer_to_gpu(x_train, dtype=dtype)
@@ -320,7 +320,7 @@ def synthetic_augmentation(x_train, y_train, dtype=cp.float32, shuffle_in_cpu=Fa
320
320
  x_balanced = list(x)
321
321
  y_balanced = list(y)
322
322
 
323
- for class_label in tqdm(range(class_count), leave=False, ascii="▱▰",
323
+ for class_label in tqdm(range(class_count), leave=False, ascii=get_loading_bar_style(),
324
324
  bar_format=bar_format, desc='Augmenting Data', ncols=52):
325
325
  class_indices = [i for i, label in enumerate(y) if cp.argmax(label) == class_label]
326
326
  num_samples = len(class_indices)
@@ -218,7 +218,7 @@ def evolver(weights,
218
218
 
219
219
  Example:
220
220
  ```python
221
- weights, activation_potentiations = planeat.evolver(weights, activation_potentiations, 1, fitness, show_info=True, strategy='normal_selective', policy='aggressive')
221
+ weights, activation_potentiations = planeat_cuda.evolver(weights, activation_potentiations, 1, fitness, show_info=True, strategy='normal_selective', policy='aggressive')
222
222
  ```
223
223
 
224
224
  - The function returns the updated weights and activations after processing based on the chosen strategy, policy, and mutation parameters.
pyerualjetwork/ui.py CHANGED
@@ -1,22 +1,23 @@
1
1
  from tqdm import tqdm
2
2
 
3
- def loading_bars():
4
-
5
- GREEN = "\033[92m"
6
- RESET = "\033[0m"
7
-
8
- bar_format_normal = f"{GREEN}{{bar}}{GREEN} {RESET} {{l_bar}} {{remaining}} {{postfix}}"
9
- bar_format_learner = f"{GREEN}{{bar}}{GREEN} {RESET} {{remaining}} {{postfix}}"
3
+ GREY = "\033[90m"
4
+ GREEN = "\033[92m"
5
+ RESET = "\033[0m"
10
6
 
7
+ def loading_bars():
8
+ bar_format_normal = "{bar} {l_bar} {remaining} {postfix}"
9
+ bar_format_learner = "{bar} {remaining} {postfix}"
11
10
  return bar_format_normal, bar_format_learner
12
11
 
12
+ def get_loading_bar_style():
13
+ return (f"{GREY}━{RESET}", f"{GREEN}━{RESET}")
13
14
 
14
- def initialize_loading_bar(total, desc, ncols, bar_format, leave=True):
15
+ def initialize_loading_bar(total, desc, ncols, bar_format, loading_bar_style=get_loading_bar_style(), leave=True):
15
16
  return tqdm(
16
17
  total=total,
17
18
  leave=leave,
18
19
  desc=desc,
19
- ascii="▱▰",
20
+ ascii=loading_bar_style,
20
21
  bar_format=bar_format,
21
22
  ncols=ncols,
22
23
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 4.5.1
3
+ Version: 4.5.2
4
4
  Summary: PyerualJetwork is a machine learning library supported with GPU(CUDA) acceleration written in Python for professionals and researchers including with PLAN algorithm, PLANEAT algorithm (genetic optimization). Also includes data pre-process and memory manegament
5
5
  Author: Hasan Can Beydili
6
6
  Author-email: tchasancan@gmail.com
@@ -1,8 +1,8 @@
1
- pyerualjetwork/__init__.py,sha256=Oe1PUj-kEsIW73oaiAxac3x_QQxSAFhOpUacNgzc6gs,1279
1
+ pyerualjetwork/__init__.py,sha256=gLefqpCFeKrA5712LsxchV-J2cN2QfDpGNwouaCaoAM,1279
2
2
  pyerualjetwork/activation_functions.py,sha256=Ms0AGBqkJuCA42ht64MSQnO54Td_1eDGquedpoBDVbc,7642
3
3
  pyerualjetwork/activation_functions_cuda.py,sha256=5y1Ti3GDfDteQDCUmODwe7tAyDAUlDTKmIikChQ8d6g,7772
4
- pyerualjetwork/data_operations.py,sha256=SOPcuCUedAVKLZ10q4uX8XVgtFAgQ2gz6efVHR6ctw0,15166
5
- pyerualjetwork/data_operations_cuda.py,sha256=X0rUCxehqyVknjBToJ0zXCTGQwlAA7GEVAcqQ-YJYfQ,17267
4
+ pyerualjetwork/data_operations.py,sha256=Y_RdxkjLEszFgeo4VDWIX1keF2syP-88KesLXA5sRyY,15280
5
+ pyerualjetwork/data_operations_cuda.py,sha256=9tyD3Bbv5__stuUampgh3_GbMhb_kmTTJmZi7BJsvuA,17381
6
6
  pyerualjetwork/fitness_functions.py,sha256=urRdeMvUhNgWxD4ZGHCRdQlIf9cTWYMvF3_aVBojRqY,1235
7
7
  pyerualjetwork/help.py,sha256=nQ_YbYA2RtuafhuvkreNpX0WWL1I_nzlelwCtvei0_Y,775
8
8
  pyerualjetwork/loss_functions.py,sha256=6PyBI232SQRGuFnG3LDGvnv_PUdWzT2_2mUODJiejGI,618
@@ -15,11 +15,11 @@ pyerualjetwork/model_operations_cuda.py,sha256=b3Bkobbrhq28AmYZ0vGxf2Hf8V2LPvoiM
15
15
  pyerualjetwork/plan.py,sha256=UyIvPmvHCHwczlc9KHolE4y6CPEeBfhnRN5yznSbnoM,23028
16
16
  pyerualjetwork/plan_cuda.py,sha256=iteqgv7x9Z2Pj4vGOZs6HXS3r0bNaF_smr7ZXaOdRnw,23990
17
17
  pyerualjetwork/planeat.py,sha256=_dnGRVBzdRUgvVCnHZ721tdXYV9PSvCz-aUnj--5VpU,38697
18
- pyerualjetwork/planeat_cuda.py,sha256=CXBF4vsTZ-fE-3W8Zc6Zxe_oKuyJS02FaHsOzSwzLV8,38731
19
- pyerualjetwork/ui.py,sha256=wu2BhU1k-w3Kcho5Jtq4SEKe68ftaUeRGneUOSCVDjU,575
18
+ pyerualjetwork/planeat_cuda.py,sha256=v-R_ZpnSeIFeSxfYOvSTXfetnfaECap2f84jBEu7X-Q,38736
19
+ pyerualjetwork/ui.py,sha256=JBTFYz5R24XwNKhA3GSW-oYAoiIBxAE3kFGXkvm5gqw,656
20
20
  pyerualjetwork/visualizations.py,sha256=utnX9zQhzmtvBJLOLNGm2jecVVk4zHXABQdjb0XzJac,28352
21
21
  pyerualjetwork/visualizations_cuda.py,sha256=gnoaaazZ-nc9E1ImqXrZBRgQ4Rnpi2qh2yGJ2eLKMlE,28807
22
- pyerualjetwork-4.5.1.dist-info/METADATA,sha256=xjGpEBnY_JunoNvXCbD1oJfdYL7Wvzj0Nt7oWj61gZg,7505
23
- pyerualjetwork-4.5.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
24
- pyerualjetwork-4.5.1.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
25
- pyerualjetwork-4.5.1.dist-info/RECORD,,
22
+ pyerualjetwork-4.5.2.dist-info/METADATA,sha256=mLFwYOUwuZ7czsv52GiAMdtP59QAORXBOVrefWXadfw,7505
23
+ pyerualjetwork-4.5.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
24
+ pyerualjetwork-4.5.2.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
25
+ pyerualjetwork-4.5.2.dist-info/RECORD,,