pyerualjetwork 3.3.4__py3-none-any.whl → 4.0.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.
@@ -1,7 +1,7 @@
1
- # pyerualjetwork/__init__.py
2
1
 
3
2
  import subprocess
4
3
  import pkg_resources
4
+ from datetime import datetime
5
5
 
6
6
  print("Auto checking and installation dependencies for PyerualJetwork")
7
7
 
@@ -46,8 +46,18 @@ for package_name in package_names:
46
46
 
47
47
  print(f"PyerualJetwork is ready to use with {err} errors")
48
48
 
49
- __version__ = "3.3.4"
50
- __update__ = "* Changes: https://github.com/HCB06/PyerualJetwork/blob/main/CHANGES (This version equal to anaplan==2.5.3)\n* PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf.\n* YouTube tutorials: https://www.youtube.com/@HasanCanBeydili"
49
+ target_date = datetime(2025, 1, 10, 0, 0, 0)
50
+
51
+ now = datetime.now()
52
+
53
+ remaining_time = target_date - now
54
+
55
+ days, seconds = divmod(remaining_time.total_seconds(), 86400)
56
+ hours, seconds = divmod(seconds, 3600)
57
+ minutes, seconds = divmod(seconds, 60)
58
+
59
+ __version__ = "4.0.1"
60
+ __update__ = f"\033[33m --- IMPORTANT NOTE! --- \n 'anaplan' name changed to 'pyerualjetwork'. Full 'pyerualjetwork' support starting January 10, 2025. TIME REMAINING TO END OF SUPPORT ANAPLAN: {int(days)} days, {int(hours):02} hours, {int(minutes):02} minutes, {int(seconds):02} seconds\033[0m\n* Changes: https://github.com/HCB06/Anaplan/blob/main/CHANGES\n* PyerualJetwork document: https://github.com/HCB06/Anaplan/blob/main/PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf.\n* YouTube tutorials: https://www.youtube.com/@HasanCanBeydili"
51
61
 
52
62
  def print_version(__version__):
53
63
  print(f"PyerualJetwork Version {__version__}" + '\n')
@@ -265,17 +265,44 @@ def predict_model_ssd(Input, model_name, model_path):
265
265
 
266
266
  Input = standard_scaler(None, Input, scaler_params)
267
267
 
268
- Wc = np.copy(W)
269
-
270
268
  neural_layer = Input
271
269
  neural_layer = np.array(neural_layer)
272
270
  neural_layer = neural_layer.ravel()
273
271
 
272
+ try:
273
+ neural_layer = feed_forward(neural_layer, np.copy(W), is_training=False, Class='?', activation_potentiation=activation_potentiation)
274
+ return neural_layer
275
+ except:
276
+ print(Fore.RED + "ERROR: Unexpected Output or wrong model parameters from: predict_model_ssd." + Style.RESET_ALL)
277
+ sys.exit()
278
+
279
+
280
+ def reverse_predict_model_ssd(output, model_name, model_path):
281
+
282
+ """
283
+ Function to make a prediction using a divided potentiation learning artificial neural network (PLAN).
284
+
285
+ Arguments:
286
+
287
+ output (list or ndarray): output layer for the model (single probability vector, output layer of trained model).
288
+
289
+ model_name (str): Name of the model.
290
+
291
+ Returns:
292
+ ndarray: Input from the model.
293
+ """
294
+
295
+ model = load_model(model_name, model_path)
274
296
 
275
- neural_layer = feed_forward(neural_layer, W, is_training=False, Class='?', activation_potentiation=activation_potentiation)
297
+ W = model[get_weights()]
276
298
 
277
- W = np.copy(Wc)
278
- return neural_layer
299
+ try:
300
+ Input = np.dot(output, np.copy(W))
301
+ return Input
302
+ except:
303
+ print(Fore.RED + "ERROR: Unexpected Output or wrong model parameters from: reverse_predict_model_ssd." + Style.RESET_ALL)
304
+ sys.exit()
305
+
279
306
 
280
307
 
281
308
  def predict_model_ram(Input, W, scaler_params=None, activation_potentiation=['linear']):
@@ -302,8 +329,6 @@ def predict_model_ram(Input, W, scaler_params=None, activation_potentiation=['li
302
329
  from .plan import feed_forward
303
330
 
304
331
  Input = standard_scaler(None, Input, scaler_params)
305
-
306
- Wc = np.copy(W)
307
332
 
308
333
  try:
309
334
 
@@ -311,15 +336,38 @@ def predict_model_ram(Input, W, scaler_params=None, activation_potentiation=['li
311
336
  neural_layer = np.array(neural_layer)
312
337
  neural_layer = neural_layer.ravel()
313
338
 
314
- neural_layer = feed_forward(neural_layer, W, is_training=False, Class='?', activation_potentiation=activation_potentiation)
339
+ neural_layer = feed_forward(neural_layer, np.copy(W), is_training=False, Class='?', activation_potentiation=activation_potentiation)
315
340
 
316
- W = np.copy(Wc)
317
341
  return neural_layer
318
342
 
319
343
  except:
320
344
  print(Fore.RED + "ERROR: Unexpected input or wrong model parameters from: predict_model_ram." + Style.RESET_ALL)
321
345
  sys.exit()
322
346
 
347
+ def reverse_predict_model_ram(output, W):
348
+
349
+ """
350
+ Function to make a prediction using a divided potentiation learning artificial neural network (PLAN).
351
+ from weights and parameters stored in memory.
352
+
353
+ Arguments:
354
+
355
+ output (list or ndarray): output layer for the model (single probability vector, output layer of trained model).
356
+
357
+ W (list of ndarrays): Weights of the model.
358
+
359
+ Returns:
360
+ ndarray: Input from the model.
361
+ """
362
+
363
+ try:
364
+ Input = np.dot(output, np.copy(W))
365
+ return Input
366
+
367
+ except:
368
+ print(Fore.RED + "ERROR: Unexpected Output or wrong model parameters from: reverse_predict_model_ram." + Style.RESET_ALL)
369
+ sys.exit()
370
+
323
371
 
324
372
  def get_weights():
325
373
 
pyerualjetwork/plan.py CHANGED
@@ -47,7 +47,7 @@ bar_format_learner = loading_bars()[1]
47
47
  def fit(
48
48
  x_train,
49
49
  y_train,
50
- val=None,
50
+ val=False,
51
51
  val_count=None,
52
52
  activation_potentiation=['linear'],
53
53
  x_val=None,
@@ -580,14 +580,11 @@ def evaluate(
580
580
 
581
581
  try:
582
582
 
583
- Wc = [0] * len(W) # Wc = Weight copy
584
583
  true_predict = 0
585
584
  y_preds = []
586
585
  y_preds_raw = []
587
586
  acc_list = []
588
587
 
589
- Wc = np.copy(W)
590
-
591
588
 
592
589
  if loading_bar_status == True:
593
590
 
@@ -600,10 +597,6 @@ def evaluate(
600
597
 
601
598
 
602
599
  neural_layer = feed_forward(neural_layer, W, is_training=False, Class='?', activation_potentiation=activation_potentiation)
603
-
604
-
605
- W = np.copy(Wc)
606
-
607
600
  neural_layer = Softmax(neural_layer)
608
601
 
609
602
  max_value = max(neural_layer)
@@ -633,13 +626,10 @@ def evaluate(
633
626
  if show_metrics == True:
634
627
 
635
628
  loading_bar.close()
636
- plot_evaluate(x_test, y_test, y_preds, acc_list, W=W, activation_potentiation=activation_potentiation)
637
-
638
- W = np.copy(Wc)
629
+ plot_evaluate(x_test, y_test, y_preds, acc_list, W=np.copy(W), activation_potentiation=activation_potentiation)
639
630
 
640
631
  except Exception as e:
641
632
 
642
- print(Fore.RED + 'ERROR:' + str(e) + Style.RESET_ALL)
643
- sys.exit()
633
+ raise(e)
644
634
 
645
635
  return W, y_preds, acc, None, None, y_preds_raw
pyerualjetwork/planeat.py CHANGED
@@ -67,7 +67,7 @@ def define_genomes(input_shape, output_shape, population_size):
67
67
  return np.array(population_weights), population_activations
68
68
 
69
69
 
70
- def evolve(weights, activation_potentiations, what_gen, y_reward, show_info=False, strategy='cross_over', policy='normal_selective', mutations=True, bad_genoms_mutation_prob=None, activation_mutate_prob=0.5, save_best_genom=True, cross_over_mode='tpm', activation_add_prob=0.5, activation_delete_prob=0.5, activation_change_prob=0.5, weight_mutate_prob=1, weight_mutate_rate=32, activation_selection_add_prob=0.5, activation_selection_change_prob=0.5, activation_selection_rate=2):
70
+ def evolve(weights, activation_potentiations, what_gen, y_reward, show_info=False, strategy='cross_over', policy='normal_selective', mutations=True, bad_genoms_mutation_prob=None, activation_mutate_prob=0.5, save_best_genom=True, cross_over_mode='tpm', activation_add_prob=0.5, activation_delete_prob=0.5, activation_change_prob=0.5, weight_mutate_prob=1, weight_mutate_rate=32, activation_selection_add_prob=0.7, activation_selection_change_prob=0.5, activation_selection_rate=2):
71
71
  """
72
72
  Applies the evolving process of a population of genomes using selection, crossover, mutation, and activation function potentiation.
73
73
  The function modifies the population's weights and activation functions based on a specified policy, mutation probabilities, and strategy.
@@ -137,7 +137,7 @@ Args:
137
137
  WARNING: if you don't understand do NOT change this value. Default is 32.
138
138
 
139
139
  activation_selection_add_prob (float, optional): The probability of adding an existing activation function for cross over.
140
- from the genome. Must be in the range [0, 1]. Default is 0.5.
140
+ from the genome. Must be in the range [0, 1]. Default is 0.7.
141
141
 
142
142
  activation_selection_change_prob (float, optional): The probability of changing an activation function in the genome for cross over.
143
143
  Must be in the range [0, 1]. Default is 0.5.
@@ -219,7 +219,7 @@ Example:
219
219
  slice_center = int(len(y_reward) / 2)
220
220
 
221
221
  else:
222
- raise ValueError("genom population size must be even number. for example: not 99, make 100 or 98.")
222
+ raise ValueError("genome population size must be even number. for example: not 99, make 100 or 98.")
223
223
 
224
224
  sort_indices = np.argsort(y_reward)
225
225
 
@@ -1,25 +1,19 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 3.3.4
4
- Summary: * PyerualJetwork is a machine learning library written in Python for professionals, incorporating advanced, unique, new, and modern techniques.
3
+ Version: 4.0.1
4
+ Summary: PyerualJetwork is a machine learning library written in Python for professionals, incorporating advanced, unique, new, and modern techniques.
5
5
  Author: Hasan Can Beydili
6
6
  Author-email: tchasancan@gmail.com
7
7
  Keywords: model evaluation,classification,potentiation learning artificial neural networks,NEAT,genetic algorithms,reinforcement learning,neural networks
8
8
  Description-Content-Type: text/markdown
9
9
 
10
- # PyerualJetwork [![Socket Badge](https://socket.dev/api/badge/pypi/package/pyerualjetwork/3.3.4?artifact_id=tar-gz)](https://socket.dev/pypi/package/pyerualjetwork/overview/2.5.0/tar-gz) [![CodeFactor](https://www.codefactor.io/repository/github/hcb06/PyerualJetwork/badge)](https://www.codefactor.io/repository/github/hcb06/PyerualJetwork) [![PyPI Downloads](https://static.pepy.tech/badge/PyerualJetwork)](https://pepy.tech/projects/PyerualJetwork) + [![PyPI Downloads](https://static.pepy.tech/badge/anaplan)](https://pepy.tech/projects/pyerualjetwork) [![PyPI Downloads](https://static.pepy.tech/badge/PyerualJetwork/month)](https://pepy.tech/projects/PyerualJetwork) [![PyPI Downloads](https://static.pepy.tech/badge/anaplan/week)](https://pepy.tech/projects/anaplan) [![PyPI version](https://img.shields.io/pypi/v/PyerualJetwork.svg)](https://pypi.org/project/anaplan/)
10
+ # PyerualJetwork [![Socket Badge](https://socket.dev/api/badge/pypi/package/anaplan/2.5.0?artifact_id=tar-gz)](https://socket.dev/pypi/package/anaplan/overview/2.5.0/tar-gz) [![CodeFactor](https://www.codefactor.io/repository/github/hcb06/anaplan/badge)](https://www.codefactor.io/repository/github/hcb06/anaplan) [![PyPI Downloads](https://static.pepy.tech/badge/anaplan)](https://pepy.tech/projects/anaplan) + [![PyPI Downloads](https://static.pepy.tech/badge/pyerualjetwork)](https://pepy.tech/projects/pyerualjetwork) [![PyPI Downloads](https://static.pepy.tech/badge/anaplan/month)](https://pepy.tech/projects/anaplan) [![PyPI Downloads](https://static.pepy.tech/badge/anaplan/week)](https://pepy.tech/projects/anaplan) [![PyPI version](https://img.shields.io/pypi/v/pyerualjetwork.svg)](https://pypi.org/project/pyerualjetwork/)
11
11
 
12
- Note: anaplan old name of pyerualjetwork.
13
-
14
- The first version of PyerualJetwork was released on May 22, 2024, and its latest version was released on August 22, 2024, and no further versions will be released. Anaplan launched its first version on August 30, 2024, as a continuation of PyerualJetwork. Only the name has been changed.
15
-
16
- IMPORTAT CHANGE!
17
-
18
- I recently updated the name of the library I published as "pyerualjetwork" to "anaplan." However, due to copyright issues and branding concerns, I have decided to revert to the original name, "pyerualjetwork." From now on, you can access the library by installing version pyerualjetwork(3.3.4) using the command pip install pyerualjetwork, replacing the current "anaplan(2.5.3)" modules.
12
+ Note: This library will support the name 'anaplan' until January 10, 2025. However, starting from January 10, 2025, it will begin supporting the name 'pyerualjetwork.' Instead of using pip install anaplan, you will need to use 'pip install pyerualjetwork' and then 'from pyerualjetwork import anaplan_module'. The name 'anaplan' will no longer be in use.
13
+ REASON: https://github.com/HCB06/Anaplan/blob/main/CHANGES
19
14
 
20
15
  https://libraries.io/pypi/pyerualjetwork
21
16
 
22
- https://libraries.io/pypi/anaplan (end of support)
23
17
 
24
18
  pip install pyerualjetwork
25
19
 
@@ -28,7 +22,7 @@ https://libraries.io/pypi/anaplan (end of support)
28
22
  from pyerualjetwork import data_operations
29
23
  from pyerualjetwork import model_operations
30
24
 
31
- Optimized for Visual Studio Code(Note: Improved for other ides in 1.5.8>.)
25
+ Optimized for Visual Studio Code
32
26
 
33
27
  requires=[
34
28
  'setuptools==75.6.0'
@@ -56,9 +50,9 @@ PyerualJetwork is free to use for commercial business and individual users. Pyer
56
50
  As of 12/21/2024, the library includes PLAN and PLANEAT module, but other machine learning modules are expected to be added in the future.
57
51
  <br><br>
58
52
 
59
- PyerualJetwork includes Plan Vision, NLPlan, PLANEAT and at the between of both, Deep Plan:<br>
53
+ PyerualJetworket includes Plan Vision, NLPlan, PLANEAT and at the between of both, Deep Plan.<br>
60
54
 
61
- ![PyerualJetwork](https://github.com/HCB06/PyerualJetwork/blob/main/Media/PyerualJetwork.jpg)<br><br><br>
55
+ ![PyerualJetwork](https://github.com/HCB06/PyerualJetwork/blob/main/Media/anaplanet_logo_final.png)<br><br><br>
62
56
 
63
57
  PLAN VISION:<br>
64
58
 
@@ -89,8 +83,8 @@ You can create artificial intelligence models that perform reinforcement learnin
89
83
 
90
84
  HOW DO I IMPORT IT TO MY PROJECT?
91
85
 
92
- Anaconda users can access the 'Anaconda Prompt' terminal from the Start menu and add the necessary library modules to the Python module search queue by typing "pip install PyerualJetwork" and pressing enter. If you are not using Anaconda, you can simply open the 'cmd' Windows command terminal from the Start menu and type "pip install pyerualjetwork". (Visual Studio Code reccomended) After installation, it's important to periodically open the terminal of the environment you are using and stay up to date by using the command "pip install pyerualjetwork --upgrade".
93
-
86
+ Anaconda users can access the 'Anaconda Prompt' terminal from the Start menu and add the necessary library modules to the Python module search queue by typing "pip install pyerualjetwork" and pressing enter. If you are not using Anaconda, you can simply open the 'cmd' Windows command terminal from the Start menu and type "pip install PyerualJetwork". (Visual Studio Code reccomended) After installation, it's important to periodically open the terminal of the environment you are using and stay up to date by using the command "pip install PyerualJetwork --upgrade".
87
+
94
88
  After installing the module using "pip" you can now call the library module in your project environment. Use: “from pyerualjetwork import plan”. Now, you can call the necessary functions from the plan module.
95
89
 
96
- The PLAN algorithm will not be explained in this document. This document focuses on how professionals can integrate and use PyerualJetwork in their systems. However, briefly, the PLAN algorithm can be described as a classification algorithm. PLAN algorithm achieves this task with an incredibly energy-efficient, fast, and hyperparameter-free user-friendly approach. For more detailed information, you can check out ![PyerualJetwork USER MANUEL](https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf) file.
90
+ The PLAN algorithm will not be explained in this document. This document focuses on how professionals can integrate and use PyerualJetwork in their systems. However, briefly, the PLAN algorithm can be described as a classification algorithm. PLAN algorithm achieves this task with an incredibly energy-efficient, fast, and hyperparameter-free user-friendly approach. For more detailed information, you can check out ![PYERUALJETWORK USER MANUEL](https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf) file.
@@ -1,15 +1,15 @@
1
- pyerualjetwork/__init__.py,sha256=yCGt50_kQMcIUlfeuwqyuxvH8YZs1varJ_bZr4musN8,2404
1
+ pyerualjetwork/__init__.py,sha256=E7mNgAbXBll7aKAgJSKMSkqaXNLIVUjK3PNhBVrUUYA,2878
2
2
  pyerualjetwork/activation_functions.py,sha256=iJpdsX8FqZ3lB3x-YG7d9-em8xHD0y1ciJLNWmI7Y6A,9941
3
3
  pyerualjetwork/data_operations.py,sha256=mph66_qGQHxhg_gQtTuOzP2PjTwJsxTGzmRmvrzlQn4,12747
4
4
  pyerualjetwork/help.py,sha256=5Du_Cja5iPvGeVS9dAoehKTJmRgb_7c6Qsn7Cy2ZfTs,823
5
5
  pyerualjetwork/loss_functions.py,sha256=6PyBI232SQRGuFnG3LDGvnv_PUdWzT2_2mUODJiejGI,618
6
6
  pyerualjetwork/metrics.py,sha256=q7MkhnZDRbCjFBDDfUgrl8lBYnUT_1ro1LxeBq105pI,6077
7
- pyerualjetwork/model_operations.py,sha256=f_k_wdPAYXVmzH01kQ2UTbcYO89DaU6_8UbK-XSX-z8,10492
8
- pyerualjetwork/plan.py,sha256=R8e8-S5F9eQOb9YZA6VQ9BCu94gJXMfn_nKkl4ZNpQE,31848
9
- pyerualjetwork/planeat.py,sha256=luHDiRK7u2qonXXZb6i7arQNINVsxEDJtYzCc2prBLM,38060
7
+ pyerualjetwork/model_operations.py,sha256=zkEP6wkrLMq0U09SgnrGpOEkaWCTlYzioMM4qUgQgRM,12067
8
+ pyerualjetwork/plan.py,sha256=PfsSNFe1qY_MIF1MoM_pbP-1s_HrADSLUsW9AI15nIk,31621
9
+ pyerualjetwork/planeat.py,sha256=3l4c-sMqTY6mQvW9u2OarcccUYcMxqASQXgx1GjNZSA,38061
10
10
  pyerualjetwork/ui.py,sha256=wu2BhU1k-w3Kcho5Jtq4SEKe68ftaUeRGneUOSCVDjU,575
11
11
  pyerualjetwork/visualizations.py,sha256=DvbiQGlvlKNAgBJ3O3ukAi6uxSheha9SRFh5YX7ZxIA,26678
12
- pyerualjetwork-3.3.4.dist-info/METADATA,sha256=n8SfmASS3u5rofDA4PR9kJgTo74PAd8KIs1q8LK6aUY,6892
13
- pyerualjetwork-3.3.4.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
14
- pyerualjetwork-3.3.4.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
15
- pyerualjetwork-3.3.4.dist-info/RECORD,,
12
+ pyerualjetwork-4.0.1.dist-info/METADATA,sha256=zHIFEFV70kHBhmHlnbxfQRylHQ4XufhM8j30w0SDhnE,6430
13
+ pyerualjetwork-4.0.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
14
+ pyerualjetwork-4.0.1.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
15
+ pyerualjetwork-4.0.1.dist-info/RECORD,,