Repository navigation
Expand file tree
/
Copy pathpython_examples.json
More file actions
781 lines (781 loc) · 33.1 KB
/
Copy pathpython_examples.json
File metadata and controls
781 lines (781 loc) · 33.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
[
{
"path": "example.py",
"title": "First GA run",
"description": "Optimize a linear equation, inspect the best solution, plot fitness, and save and reload the GA.",
"category": "Getting Started",
"guide": "steps_to_use.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/example.py"
},
{
"path": "example_initial_population.py",
"title": "Initial populations",
"description": "Generate values from per-gene ranges and nested spaces, or supply values and infer the dimensions.",
"category": "Population and Genes",
"guide": "gene_values.md",
"requirements": "PyGAD",
"run": "python examples/example_initial_population.py"
},
{
"path": "example_gene_space.py",
"title": "Gene spaces",
"description": "Compare shared and per-gene choices, ranges, dictionaries, fixed values, and None entries.",
"category": "Population and Genes",
"guide": "gene_values.md",
"requirements": "PyGAD",
"run": "python examples/example_gene_space.py"
},
{
"path": "example_gene_constraint.py",
"title": "Gene constraints",
"description": "Filter gene candidates with constraints that depend on other genes.",
"category": "Population and Genes",
"guide": "gene_values.md",
"requirements": "PyGAD",
"run": "python examples/example_gene_constraint.py"
},
{
"path": "example_duplicate_gene_repair.py",
"title": "Duplicate repair",
"description": "Repair duplicates through a chain of replacements while respecting each gene space.",
"category": "Population and Genes",
"guide": "gene_values.md",
"requirements": "PyGAD",
"run": "python examples/example_duplicate_gene_repair.py"
},
{
"path": "example_gene_type_conversion.py",
"title": "Gene types and rounding",
"description": "Preserve mixed numeric types, apply precision, and convert custom mutation outputs.",
"category": "Population and Genes",
"guide": "gene_values.md",
"requirements": "PyGAD",
"run": "python examples/example_gene_type_conversion.py"
},
{
"path": "example_dynamic_population_size.py",
"title": "Changing population size",
"description": "Adjust the population and related runtime settings during evolution.",
"category": "Population and Genes",
"guide": "generations.md",
"requirements": "PyGAD",
"run": "python examples/example_dynamic_population_size.py"
},
{
"path": "example_custom_operators.py",
"title": "Custom GA operators",
"description": "Implement parent selection, crossover, and mutation functions.",
"category": "Operators and Configuration",
"guide": "user_defined_operators.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/example_custom_operators.py"
},
{
"path": "example_constructor_parameters.py",
"title": "Constructor settings and random seeds",
"description": "Use callable fitness signatures, NumPy counts, and independent seeded GA instances.",
"category": "Operators and Configuration",
"guide": "pygad.md",
"requirements": "PyGAD",
"run": "python examples/example_constructor_parameters.py"
},
{
"path": "example_fitness_batch_size.py",
"title": "Batch fitness",
"description": "Return one fitness result per solution, including a shorter final batch.",
"category": "Fitness and Parallel Processing",
"guide": "fitness_calculation.md",
"requirements": "PyGAD",
"run": "python examples/example_fitness_batch_size.py"
},
{
"path": "example_parallel_processing.py",
"title": "Parallel fitness",
"description": "Evaluate population fitness with process workers and report the run time.",
"category": "Fitness and Parallel Processing",
"guide": "fitness_calculation.md",
"requirements": "PyGAD",
"run": "python examples/example_parallel_processing.py"
},
{
"path": "benchmarks/parallel_processing.py",
"title": "Compare fitness execution modes",
"description": "Measure complete runs for CPU, I/O, and NumPy workloads with serial, thread, process, and batch evaluation.",
"category": "Fitness and Parallel Processing",
"guide": "fitness_calculation.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/parallel_processing.py --workload cpu"
},
{
"path": "example_fitness_wrapper.py",
"title": "Extra fitness arguments",
"description": "Wrap a fitness function to pass additional values while preserving its PyGAD signature.",
"category": "Fitness and Parallel Processing",
"guide": "custom_functions.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/example_fitness_wrapper.py"
},
{
"path": "pygad_lifecycle.py",
"title": "Lifecycle callbacks",
"description": "Trace fitness, parent selection, crossover, mutation, generation, and stop callbacks.",
"category": "Lifecycle and Saved Runs",
"guide": "lifecycle.md",
"requirements": "PyGAD",
"run": "python examples/pygad_lifecycle.py"
},
{
"path": "example_lifecycle_methods.py",
"title": "Callbacks as methods",
"description": "Implement fitness and lifecycle callbacks with bound methods.",
"category": "Lifecycle and Saved Runs",
"guide": "custom_functions.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/example_lifecycle_methods.py"
},
{
"path": "example_lifecycle_classes.py",
"title": "Callbacks as callable classes",
"description": "Implement fitness and lifecycle callbacks with callable class instances.",
"category": "Lifecycle and Saved Runs",
"guide": "custom_functions.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/example_lifecycle_classes.py"
},
{
"path": "example_summary.py",
"title": "Text lifecycle summary",
"description": "Print the configured GA stages and their parameters.",
"category": "Lifecycle and Saved Runs",
"guide": "pygad_more.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/example_summary.py"
},
{
"path": "example_logger.py",
"title": "Logging",
"description": "Send progress and GA messages to a configured logger.",
"category": "Lifecycle and Saved Runs",
"guide": "logging.md",
"requirements": "PyGAD",
"run": "python examples/example_logger.py"
},
{
"path": "example_repeated_runs.py",
"title": "Repeated runs and checkpoints",
"description": "Continue from a saved GA and inspect the actual generation numbers in its histories.",
"category": "Lifecycle and Saved Runs",
"guide": "generations.md",
"requirements": "PyGAD",
"run": "python examples/example_repeated_runs.py"
},
{
"path": "example_load_fitness_function.py",
"title": "Change a loaded fitness function",
"description": "Replace the fitness callable after loading, or start fresh when the objective changes.",
"category": "Lifecycle and Saved Runs",
"guide": "pygad.md",
"requirements": "PyGAD",
"run": "python examples/example_load_fitness_function.py"
},
{
"path": "example_multi_objective.py",
"title": "NSGA-II optimization",
"description": "Optimize two objectives and inspect the resulting trade-offs.",
"category": "Multi-Objective Optimization",
"guide": "multi_objective.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/example_multi_objective.py"
},
{
"path": "example_multi_objective_nsga3.py",
"title": "NSGA-III optimization",
"description": "Configure reference points and optimize two objectives with NSGA-III.",
"category": "Multi-Objective Optimization",
"guide": "multi_objective.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/example_multi_objective_nsga3.py"
},
{
"path": "plots/example_plot_fitness.py",
"title": "Best-fitness curve",
"description": "Plot best fitness across generations on the Sphere benchmark.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_fitness.py"
},
{
"path": "plots/example_plot_fitness_band.py",
"title": "Fitness band",
"description": "Plot per-generation minimum, mean, and maximum fitness with a shaded band.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_fitness_band.py"
},
{
"path": "plots/example_plot_genes.py",
"title": "Gene histories",
"description": "Show how gene values change across saved generations.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_genes.py"
},
{
"path": "plots/example_plot_lifecycle.py",
"title": "Configured lifecycle",
"description": "Draw detailed and compact lifecycle charts and export SVG and PNG files.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_lifecycle.py"
},
{
"path": "plots/example_plot_new_solution_rate.py",
"title": "New-solution rate",
"description": "Count previously unseen solutions in each generation.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_new_solution_rate.py"
},
{
"path": "plots/example_plot_non_dominated_hypervolume.py",
"title": "Hypervolume history",
"description": "Track the hypervolume of the non-dominated set across generations.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_non_dominated_hypervolume.py"
},
{
"path": "plots/example_plot_pareto_front_curve_2d.py",
"title": "2D Pareto front",
"description": "Plot a two-objective Pareto front after NSGA-II optimization.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_pareto_front_curve_2d.py"
},
{
"path": "plots/example_plot_pareto_front_curve_3d.py",
"title": "3D Pareto front",
"description": "Plot a three-objective Pareto front after NSGA-III optimization.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_pareto_front_curve_3d.py"
},
{
"path": "plots/example_plot_pareto_front_evolution.py",
"title": "Pareto-front evolution",
"description": "Overlay the non-dominated fronts from selected generations.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_pareto_front_evolution.py"
},
{
"path": "plots/example_plot_pareto_front_heatmap.py",
"title": "Pareto heatmap",
"description": "Compare objective values with a solutions-by-objectives heatmap.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_pareto_front_heatmap.py"
},
{
"path": "plots/example_plot_pareto_front_pcp.py",
"title": "Parallel coordinates",
"description": "Compare Pareto solutions across objective axes.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_pareto_front_pcp.py"
},
{
"path": "plots/example_plot_pareto_front_scatter_matrix.py",
"title": "Pareto scatter matrix",
"description": "Compare every pair of objectives in a many-objective run.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_pareto_front_scatter_matrix.py"
},
{
"path": "plots/example_plot_population_diversity.py",
"title": "Population diversity",
"description": "Track mean pairwise distance between solutions across generations.",
"category": "Plots",
"guide": "visualize.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/plots/example_plot_population_diversity.py"
},
{
"path": "example_generate_report.py",
"title": "PDF report",
"description": "Export the run configuration, summary, best solution, and applicable plots to PDF.",
"category": "Reports",
"guide": "pygad.md",
"requirements": "PyGAD with the report extra (Matplotlib and ReportLab)",
"run": "python examples/example_generate_report.py"
},
{
"path": "benchmarks/example_classic_sphere.py",
"title": "Sphere",
"description": "Optimize the Sphere single-objective benchmark.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_classic_sphere.py"
},
{
"path": "benchmarks/example_classic_rastrigin.py",
"title": "Rastrigin",
"description": "Optimize the Rastrigin single-objective benchmark.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_classic_rastrigin.py"
},
{
"path": "benchmarks/example_classic_rosenbrock.py",
"title": "Rosenbrock",
"description": "Optimize the Rosenbrock single-objective benchmark.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_classic_rosenbrock.py"
},
{
"path": "benchmarks/example_classic_griewank.py",
"title": "Griewank",
"description": "Optimize the Griewank single-objective benchmark.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_classic_griewank.py"
},
{
"path": "benchmarks/example_classic_schwefel.py",
"title": "Schwefel",
"description": "Optimize the Schwefel single-objective benchmark.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_classic_schwefel.py"
},
{
"path": "benchmarks/example_classic_ackley.py",
"title": "Ackley",
"description": "Optimize the Ackley single-objective benchmark.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_classic_ackley.py"
},
{
"path": "benchmarks/example_classic_himmelblau.py",
"title": "Himmelblau",
"description": "Optimize the Himmelblau single-objective benchmark.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_classic_himmelblau.py"
},
{
"path": "benchmarks/example_zdt1.py",
"title": "ZDT1",
"description": "Optimize the ZDT1 problem and plot its Pareto front.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/benchmarks/example_zdt1.py"
},
{
"path": "benchmarks/example_zdt2.py",
"title": "ZDT2",
"description": "Optimize the ZDT2 problem and plot its Pareto front.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/benchmarks/example_zdt2.py"
},
{
"path": "benchmarks/example_zdt3.py",
"title": "ZDT3",
"description": "Optimize the ZDT3 problem and plot its Pareto front.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/benchmarks/example_zdt3.py"
},
{
"path": "benchmarks/example_zdt4.py",
"title": "ZDT4",
"description": "Optimize the ZDT4 problem and plot its Pareto front.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/benchmarks/example_zdt4.py"
},
{
"path": "benchmarks/example_zdt6.py",
"title": "ZDT6",
"description": "Optimize the ZDT6 problem and plot its Pareto front.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/benchmarks/example_zdt6.py"
},
{
"path": "benchmarks/example_dtlz1.py",
"title": "DTLZ1",
"description": "Optimize the DTLZ1 problem and plot its Pareto front.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_dtlz1.py"
},
{
"path": "benchmarks/example_dtlz2.py",
"title": "DTLZ2",
"description": "Optimize the DTLZ2 problem and plot its Pareto front.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_dtlz2.py"
},
{
"path": "benchmarks/example_dtlz3.py",
"title": "DTLZ3",
"description": "Optimize the DTLZ3 problem and plot its Pareto front.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_dtlz3.py"
},
{
"path": "benchmarks/example_dtlz4.py",
"title": "DTLZ4",
"description": "Optimize the DTLZ4 problem and plot its Pareto front.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_dtlz4.py"
},
{
"path": "benchmarks/example_knapsack.py",
"title": "Knapsack",
"description": "Select items to maximize value within a weight capacity.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_knapsack.py"
},
{
"path": "benchmarks/example_tsp.py",
"title": "Travelling salesman",
"description": "Find a short tour using a permutation of four cities.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD",
"run": "python examples/benchmarks/example_tsp.py"
},
{
"path": "quality_indicators/example_hypervolume.py",
"title": "Hypervolume",
"description": "Measure the objective-space volume dominated by the final population.",
"category": "Quality Indicators",
"guide": "utils.md",
"requirements": "PyGAD",
"run": "python examples/quality_indicators/example_hypervolume.py"
},
{
"path": "quality_indicators/example_inverted_generational_distance.py",
"title": "Inverted generational distance",
"description": "Measure distance from a reference front to the approximation.",
"category": "Quality Indicators",
"guide": "utils.md",
"requirements": "PyGAD",
"run": "python examples/quality_indicators/example_inverted_generational_distance.py"
},
{
"path": "quality_indicators/example_generational_distance.py",
"title": "Generational distance",
"description": "Measure distance from the approximation to a reference front.",
"category": "Quality Indicators",
"guide": "utils.md",
"requirements": "PyGAD",
"run": "python examples/quality_indicators/example_generational_distance.py"
},
{
"path": "quality_indicators/example_spacing.py",
"title": "Spacing",
"description": "Measure how evenly the approximation points are spread.",
"category": "Quality Indicators",
"guide": "utils.md",
"requirements": "PyGAD",
"run": "python examples/quality_indicators/example_spacing.py"
},
{
"path": "nn/example_regression.py",
"title": "Regression",
"description": "Fit a neural network to a small numeric regression problem.",
"category": "Neural Networks",
"guide": "nn_regression_1.md",
"requirements": "PyGAD",
"run": "python examples/nn/example_regression.py"
},
{
"path": "nn/example_XOR_classification.py",
"title": "XOR classification",
"description": "Train a neural network on the four XOR inputs.",
"category": "Neural Networks",
"guide": "nn_xor.md",
"requirements": "PyGAD",
"run": "python examples/nn/example_XOR_classification.py"
},
{
"path": "nn/example_classification.py",
"title": "Image classification",
"description": "Classify fruit images from prepared feature vectors.",
"category": "Neural Networks",
"guide": "nn_image_classification.md",
"requirements": "PyGAD",
"run": "cd examples/nn\npython example_classification.py",
"data": "examples/data/dataset_features.npy and examples/data/outputs.npy.",
"download": false,
"run_note": "From the repository root, change to examples/nn/ so the relative data paths resolve:"
},
{
"path": "nn/example_regression_fish.py",
"title": "Fish-weight regression",
"description": "Predict fish weight from numeric measurements.",
"category": "Neural Networks",
"guide": "nn_regression_2.md",
"requirements": "PyGAD, pandas",
"run": "cd examples/nn\npython example_regression_fish.py",
"data": "examples/data/Fish.csv.",
"download": false,
"run_note": "From the repository root, change to examples/nn/ so the relative data paths resolve:"
},
{
"path": "gann/example_regression.py",
"title": "Regression",
"description": "Fit a neural network to a small numeric regression problem.",
"category": "Neural Networks with the GA",
"guide": "gann_regression_1.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/gann/example_regression.py"
},
{
"path": "gann/example_XOR_classification.py",
"title": "XOR classification",
"description": "Train a neural network on the four XOR inputs.",
"category": "Neural Networks with the GA",
"guide": "gann_xor.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/gann/example_XOR_classification.py"
},
{
"path": "gann/example_classification.py",
"title": "Image classification",
"description": "Classify fruit images from prepared feature vectors.",
"category": "Neural Networks with the GA",
"guide": "gann_image_classification.md",
"requirements": "PyGAD, Matplotlib",
"run": "cd examples/gann\npython example_classification.py",
"data": "examples/data/dataset_features.npy and examples/data/outputs.npy.",
"download": false,
"run_note": "From the repository root, change to examples/gann/ so the relative data paths resolve:"
},
{
"path": "gann/example_regression_fish.py",
"title": "Fish-weight regression",
"description": "Predict fish weight from numeric measurements.",
"category": "Neural Networks with the GA",
"guide": "gann_regression_2.md",
"requirements": "PyGAD, Matplotlib, pandas",
"run": "cd examples/gann\npython example_regression_fish.py",
"data": "examples/data/Fish.csv.",
"download": false,
"run_note": "From the repository root, change to examples/gann/ so the relative data paths resolve:"
},
{
"path": "nn/extract_features.py",
"title": "Prepare image features",
"description": "Extract fruit-image features and write the arrays used by the dense classifiers.",
"category": "Neural Networks",
"guide": "nn_image_classification.md",
"requirements": "PyGAD, scikit-image",
"run": "cd examples/nn\npython extract_features.py",
"data": "The apple, lemon, mango, and raspberry folders under examples/data/Fruit360/.",
"download": false,
"run_note": "From the repository root, change to examples/nn/ so the relative data paths resolve:"
},
{
"path": "cnn/example_image_classification.py",
"title": "Build a CNN",
"description": "Classify fruit images using prepared image arrays.",
"category": "Convolutional Networks",
"guide": "cnn.md",
"requirements": "PyGAD",
"run": "cd examples/cnn\npython example_image_classification.py",
"data": "examples/data/dataset_inputs.npy and examples/data/dataset_outputs.npy.",
"download": false,
"run_note": "From the repository root, change to examples/cnn/ so the relative data paths resolve:"
},
{
"path": "gacnn/example_image_classification.py",
"title": "Optimize a CNN with the GA",
"description": "Classify fruit images using prepared image arrays.",
"category": "Convolutional Networks",
"guide": "gacnn.md",
"requirements": "PyGAD, Matplotlib",
"run": "cd examples/gacnn\npython example_image_classification.py",
"data": "examples/data/dataset_inputs.npy and examples/data/dataset_outputs.npy.",
"download": false,
"run_note": "From the repository root, change to examples/gacnn/ so the relative data paths resolve:"
},
{
"path": "KerasGA/regression_example.py",
"title": "Regression",
"description": "Optimize neural-network weights with the genetic algorithm.",
"category": "Keras",
"guide": "kerasga_regression.md",
"requirements": "PyGAD, Matplotlib, TensorFlow/Keras",
"run": "python examples/KerasGA/regression_example.py"
},
{
"path": "KerasGA/XOR_classification.py",
"title": "XOR classification",
"description": "Optimize neural-network weights with the genetic algorithm.",
"category": "Keras",
"guide": "kerasga_xor.md",
"requirements": "PyGAD, Matplotlib, TensorFlow/Keras",
"run": "python examples/KerasGA/XOR_classification.py"
},
{
"path": "KerasGA/image_classification_Dense.py",
"title": "Dense image classifier",
"description": "Train an image classifier with the genetic algorithm.",
"category": "Keras",
"guide": "kerasga_image_dense.md",
"requirements": "PyGAD, Matplotlib, TensorFlow/Keras",
"run": "cd examples/KerasGA\npython image_classification_Dense.py",
"data": "examples/data/dataset_features.npy and examples/data/outputs.npy.",
"download": false,
"run_note": "From the repository root, change to examples/KerasGA/ so the relative data paths resolve:"
},
{
"path": "KerasGA/image_classification_CNN.py",
"title": "Convolutional image classifier",
"description": "Train an image classifier with the genetic algorithm.",
"category": "Keras",
"guide": "kerasga_image_conv.md",
"requirements": "PyGAD, Matplotlib, TensorFlow/Keras",
"run": "cd examples/KerasGA\npython image_classification_CNN.py",
"data": "examples/data/dataset_inputs.npy and examples/data/dataset_outputs.npy.",
"download": false,
"run_note": "From the repository root, change to examples/KerasGA/ so the relative data paths resolve:"
},
{
"path": "TorchGA/regression_example.py",
"title": "Regression",
"description": "Optimize neural-network weights with the genetic algorithm.",
"category": "PyTorch",
"guide": "torchga_regression.md",
"requirements": "PyGAD, Matplotlib, PyTorch",
"run": "python examples/TorchGA/regression_example.py"
},
{
"path": "TorchGA/XOR_classification.py",
"title": "XOR classification",
"description": "Optimize neural-network weights with the genetic algorithm.",
"category": "PyTorch",
"guide": "torchga_xor.md",
"requirements": "PyGAD, Matplotlib, PyTorch",
"run": "python examples/TorchGA/XOR_classification.py"
},
{
"path": "TorchGA/image_classification_Dense.py",
"title": "Dense image classifier",
"description": "Train an image classifier with the genetic algorithm.",
"category": "PyTorch",
"guide": "torchga_image_dense.md",
"requirements": "PyGAD, Matplotlib, TensorFlow/Keras, PyTorch",
"run": "cd examples/TorchGA\npython image_classification_Dense.py",
"data": "examples/data/dataset_features.npy and examples/data/outputs.npy.",
"download": false,
"run_note": "From the repository root, change to examples/TorchGA/ so the relative data paths resolve:"
},
{
"path": "TorchGA/image_classification_CNN.py",
"title": "Convolutional image classifier",
"description": "Train an image classifier with the genetic algorithm.",
"category": "PyTorch",
"guide": "torchga_image_conv.md",
"requirements": "PyGAD, Matplotlib, PyTorch",
"run": "cd examples/TorchGA\npython image_classification_CNN.py",
"data": "examples/data/dataset_inputs.npy and examples/data/dataset_outputs.npy.",
"download": false,
"run_note": "From the repository root, change to examples/TorchGA/ so the relative data paths resolve:"
},
{
"path": "KerasGA/cancer_dataset.py",
"title": "Image-directory classification",
"description": "Use directory-based image input for a two-class Keras CNN.",
"category": "Keras",
"guide": "kerasga_image_datagen.md",
"requirements": "PyGAD, Matplotlib, TensorFlow/Keras",
"run": "cd examples/KerasGA\npython cancer_dataset.py",
"data": "benign/ and malignant/ image folders under examples/data/Skin_Cancer_Dataset/.",
"download": false,
"run_note": "From the repository root, change to examples/KerasGA/ so the relative data paths resolve:"
},
{
"path": "KerasGA/cancer_dataset_generator.py",
"title": "Batched image-directory classification",
"description": "Use directory-based image input for a two-class Keras CNN.",
"category": "Keras",
"guide": "kerasga_image_datagen.md",
"requirements": "PyGAD, Matplotlib, TensorFlow/Keras",
"run": "cd examples/KerasGA\npython cancer_dataset_generator.py",
"data": "benign/ and malignant/ image folders under examples/data/Skin_Cancer_Dataset/.",
"download": false,
"run_note": "From the repository root, change to examples/KerasGA/ so the relative data paths resolve:"
},
{
"path": "clustering/example_clustering_2.py",
"title": "2-cluster example",
"description": "Optimize 2 cluster centers for generated two-dimensional data.",
"category": "Clustering",
"guide": "pygad.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/clustering/example_clustering_2.py"
},
{
"path": "clustering/example_clustering_3.py",
"title": "3-cluster example",
"description": "Optimize 3 cluster centers for generated two-dimensional data.",
"category": "Clustering",
"guide": "pygad.md",
"requirements": "PyGAD, Matplotlib",
"run": "python examples/clustering/example_clustering_3.py"
},
{
"path": "example_travelling_salesman.ipynb",
"title": "Travelling-salesman Colab notebook",
"description": "Explore a city-tour problem using a user-supplied CSV and interactive maps.",
"category": "Benchmarks",
"guide": "benchmarks.md",
"requirements": "PyGAD, Google Colab, NumPy, pandas, Plotly, folium, and geopy",
"run": "",
"data": "The notebook reads /content/sample_data/startbucks.csv in Google Colab. Supply a compatible CSV at that path. The original data source was not recorded. For local Jupyter use, adapt the Colab-specific imports and CSV path.",
"download": false
}
]