algopipe 0.1.0__tar.gz

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.
Files changed (165) hide show
  1. algopipe-0.1.0/LICENSE +0 -0
  2. algopipe-0.1.0/PKG-INFO +13 -0
  3. algopipe-0.1.0/README.md +0 -0
  4. algopipe-0.1.0/pyproject.toml +20 -0
  5. algopipe-0.1.0/setup.cfg +4 -0
  6. algopipe-0.1.0/src/AlgoPipe/__init__.py +0 -0
  7. algopipe-0.1.0/src/AlgoPipe/cli.py +76 -0
  8. algopipe-0.1.0/src/AlgoPipe/dependency_resolver.py +0 -0
  9. algopipe-0.1.0/src/AlgoPipe/exporter.py +0 -0
  10. algopipe-0.1.0/src/AlgoPipe/generator.py +43 -0
  11. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Basic_NN/Backpropagation.py +29 -0
  12. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Basic_NN/Multi-Layer_Perceptron.py +22 -0
  13. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Basic_NN/Perceptron.py +27 -0
  14. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Basic_NN/__init__.py +0 -0
  15. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Convolutional_NN/AlexNet.py +63 -0
  16. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Convolutional_NN/ConvNEXt.py +40 -0
  17. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Convolutional_NN/DenseNet.py +57 -0
  18. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Convolutional_NN/EfficientNet.py +41 -0
  19. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Convolutional_NN/GoogLeNet.py +87 -0
  20. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Convolutional_NN/LeNet.py +39 -0
  21. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Convolutional_NN/MobileNet.py +38 -0
  22. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Convolutional_NN/ResNet.py +67 -0
  23. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Convolutional_NN/VGGNet.py +42 -0
  24. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Convolutional_NN/VisionTransformers.py +28 -0
  25. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Convolutional_NN/__init__.py +0 -0
  26. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Generative_Models/Autoencoders.py +28 -0
  27. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Generative_Models/Diffusion_models.py +0 -0
  28. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Generative_Models/Generative_Adversal_Networks.py +0 -0
  29. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Generative_Models/Variational_Autoencoders.py +0 -0
  30. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Generative_Models/__init__.py +0 -0
  31. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Graph_NeuralNetworks/GraphSAGE.py +0 -0
  32. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Graph_NeuralNetworks/Graph_Attention_Network.py +0 -0
  33. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Graph_NeuralNetworks/Graph_Convolution_Network.py +0 -0
  34. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Graph_NeuralNetworks/MessagePassing_NN.py +0 -0
  35. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Graph_NeuralNetworks/__init__.py +0 -0
  36. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Recurrent_NN/Attention_Mechanism.py +0 -0
  37. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Recurrent_NN/Bidirectional_LSTM_GRU.py +0 -0
  38. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Recurrent_NN/Gated-Recurrent_Unit.py +0 -0
  39. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Recurrent_NN/Long_Short-term_Memory.py +0 -0
  40. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Recurrent_NN/Sequence-to-sequence_models.py +0 -0
  41. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Recurrent_NN/Vanilla_RNN.py +0 -0
  42. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Recurrent_NN/__init__.py +0 -0
  43. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/ALBERT.py +0 -0
  44. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/BERT.py +0 -0
  45. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/CLIP.py +0 -0
  46. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/GPT.py +0 -0
  47. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/LLMs.py +0 -0
  48. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/RoBERTa.py +0 -0
  49. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/SwinTransformer.py +0 -0
  50. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/T5.py +0 -0
  51. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/Transformer.py +0 -0
  52. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/VisionTransformer.py +0 -0
  53. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/Whisper.py +0 -0
  54. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/XLNet.py +0 -0
  55. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/Transformer_Based_Architecture/__init__.py +0 -0
  56. algopipe-0.1.0/src/AlgoPipe/modules/DL_Algorithms/__init__.py +0 -0
  57. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Data_Balancing.py +0 -0
  58. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Data_Integration.py +0 -0
  59. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Dimensionality_Reduction.py +0 -0
  60. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Discretization.py +0 -0
  61. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Encoding_CategoricalData.py +0 -0
  62. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Feature_Scaling.py +0 -0
  63. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Feature_Selection.py +0 -0
  64. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Handling_MissingValues.py +140 -0
  65. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Handling_Outliers.py +0 -0
  66. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Image_Preprocessing.py +0 -0
  67. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Noise_reduction_Smoothing.py +0 -0
  68. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Normalization.py +0 -0
  69. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Polynomial_features.py +0 -0
  70. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/RemovingDuplicates.py +0 -0
  71. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Text_FeatureExtraction.py +0 -0
  72. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/Time_SeriesTransformations.py +0 -0
  73. algopipe-0.1.0/src/AlgoPipe/modules/Data_Preprocessing/__init__.py +3 -0
  74. algopipe-0.1.0/src/AlgoPipe/modules/Data_Spliting/__init__.py +0 -0
  75. algopipe-0.1.0/src/AlgoPipe/modules/Data_Spliting/train_test_split.py +17 -0
  76. algopipe-0.1.0/src/AlgoPipe/modules/Data_Summary/__init__.py +0 -0
  77. algopipe-0.1.0/src/AlgoPipe/modules/Data_Summary/column_types.py +24 -0
  78. algopipe-0.1.0/src/AlgoPipe/modules/Data_Summary/missing_values.py +29 -0
  79. algopipe-0.1.0/src/AlgoPipe/modules/Data_Summary/overview.py +24 -0
  80. algopipe-0.1.0/src/AlgoPipe/modules/Data_Summary/statistics.py +24 -0
  81. algopipe-0.1.0/src/AlgoPipe/modules/Data_Visualization/Bivariate_Analysis.py +63 -0
  82. algopipe-0.1.0/src/AlgoPipe/modules/Data_Visualization/Missing_Values_Visualization.py +53 -0
  83. algopipe-0.1.0/src/AlgoPipe/modules/Data_Visualization/Multivariate_Analysis.py +82 -0
  84. algopipe-0.1.0/src/AlgoPipe/modules/Data_Visualization/Pair_Plots.py +47 -0
  85. algopipe-0.1.0/src/AlgoPipe/modules/Data_Visualization/Univariate_Analysis.py +77 -0
  86. algopipe-0.1.0/src/AlgoPipe/modules/Data_Visualization/__init__.py +0 -0
  87. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Ensemble_Learning_Algorithms/Bagging.py +23 -0
  88. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Ensemble_Learning_Algorithms/Blending.py +26 -0
  89. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Ensemble_Learning_Algorithms/Boosting.py +22 -0
  90. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Ensemble_Learning_Algorithms/Stacking.py +26 -0
  91. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Ensemble_Learning_Algorithms/VotingClassifier.py +26 -0
  92. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Ensemble_Learning_Algorithms/__init__.py +0 -0
  93. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Probalistic&Bayesian_Methods/Bayesian_Networks.py +25 -0
  94. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Probalistic&Bayesian_Methods/Gaussian_Processes.py +27 -0
  95. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Probalistic&Bayesian_Methods/HiddenMarkovModels.py +22 -0
  96. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Probalistic&Bayesian_Methods/Kalman_Filters.py +34 -0
  97. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Probalistic&Bayesian_Methods/Naive_Bayes.py +22 -0
  98. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Probalistic&Bayesian_Methods/__init__.py +0 -0
  99. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Semi_Supervised_Algorithms/ContrastiveLearning.py +39 -0
  100. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Semi_Supervised_Algorithms/LabelPropogation.py +22 -0
  101. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Semi_Supervised_Algorithms/PseudoLabeling.py +23 -0
  102. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Semi_Supervised_Algorithms/__init__.py +0 -0
  103. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/AdaBoost.py +22 -0
  104. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/Decisiontree_classifier.py +22 -0
  105. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/GradientBoostingMachines.py +22 -0
  106. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/KNN.py +22 -0
  107. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/LightGBM.py +22 -0
  108. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/LinearDiscriminantAnalysis.py +22 -0
  109. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/Logistic_regression.py +22 -0
  110. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/NaiveBayes.py +22 -0
  111. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/RandomForest_classifier.py +22 -0
  112. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/SVM.py +22 -0
  113. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/XGBoost.py +22 -0
  114. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/__init__.py +0 -0
  115. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/catBoost.py +22 -0
  116. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Classification_Algorithms/quadraticDiscriminantAnalysis.py +22 -0
  117. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Regression_Algorithms/Bayesian_regression.py +22 -0
  118. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Regression_Algorithms/DecisionTree_regression.py +22 -0
  119. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Regression_Algorithms/Elastic_net_regression.py +22 -0
  120. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Regression_Algorithms/GradientBoosted_regression.py +22 -0
  121. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Regression_Algorithms/Lasso_regression.py +22 -0
  122. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Regression_Algorithms/Linear_regression.py +22 -0
  123. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Regression_Algorithms/Polynomial_regression.py +27 -0
  124. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Regression_Algorithms/RandomForest_regression.py +22 -0
  125. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Regression_Algorithms/Ridge_regression.py +22 -0
  126. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Regression_Algorithms/Support_Vector_regression.py +22 -0
  127. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/Regression_Algorithms/__init__.py +0 -0
  128. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Supervised_Learning_Algorithms/__init__.py +0 -0
  129. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/Clustering/AffinityPropogation.py +22 -0
  130. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/Clustering/DBSCAN.py +22 -0
  131. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/Clustering/GaussianMixtureModels.py +22 -0
  132. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/Clustering/HierarchicalClustering.py +22 -0
  133. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/Clustering/Kmeans.py +22 -0
  134. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/Clustering/MeanShift.py +22 -0
  135. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/Clustering/SpecrtralClustering.py +22 -0
  136. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/Clustering/__init__.py +0 -0
  137. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/DimensionalityReduction/Autoencoders.py +33 -0
  138. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/DimensionalityReduction/FactorAnalysis.py +22 -0
  139. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/DimensionalityReduction/IndependentComponentAnalysis.py +22 -0
  140. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/DimensionalityReduction/LDA.py +22 -0
  141. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/DimensionalityReduction/PCA.py +22 -0
  142. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/DimensionalityReduction/UMAP.py +21 -0
  143. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/DimensionalityReduction/__init__.py +0 -0
  144. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/DimensionalityReduction/t-SNE.py +21 -0
  145. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/Unsupervised_Learning_Algorithms/__init__.py +0 -0
  146. algopipe-0.1.0/src/AlgoPipe/modules/ML_Algorithms/__init__.py +0 -0
  147. algopipe-0.1.0/src/AlgoPipe/modules/ReinforcementLearning_Algorithms/Actor-Critic_Models.py +50 -0
  148. algopipe-0.1.0/src/AlgoPipe/modules/ReinforcementLearning_Algorithms/Deep_Q-Networks.py +38 -0
  149. algopipe-0.1.0/src/AlgoPipe/modules/ReinforcementLearning_Algorithms/MonteCarlo_TreeSearch.py +32 -0
  150. algopipe-0.1.0/src/AlgoPipe/modules/ReinforcementLearning_Algorithms/PolicyGradientMethods.py +29 -0
  151. algopipe-0.1.0/src/AlgoPipe/modules/ReinforcementLearning_Algorithms/Proximal_Policy_Optimization.py +30 -0
  152. algopipe-0.1.0/src/AlgoPipe/modules/ReinforcementLearning_Algorithms/Q-Learning.py +29 -0
  153. algopipe-0.1.0/src/AlgoPipe/modules/ReinforcementLearning_Algorithms/SARSA.py +29 -0
  154. algopipe-0.1.0/src/AlgoPipe/modules/ReinforcementLearning_Algorithms/__init__.py +0 -0
  155. algopipe-0.1.0/src/AlgoPipe/modules/__init__.py +6 -0
  156. algopipe-0.1.0/src/AlgoPipe/registry.py +56 -0
  157. algopipe-0.1.0/src/AlgoPipe/utils/__init__.py +0 -0
  158. algopipe-0.1.0/src/AlgoPipe/utils/code_extractor.py +0 -0
  159. algopipe-0.1.0/src/algopipe.egg-info/PKG-INFO +13 -0
  160. algopipe-0.1.0/src/algopipe.egg-info/SOURCES.txt +163 -0
  161. algopipe-0.1.0/src/algopipe.egg-info/dependency_links.txt +1 -0
  162. algopipe-0.1.0/src/algopipe.egg-info/entry_points.txt +2 -0
  163. algopipe-0.1.0/src/algopipe.egg-info/requires.txt +3 -0
  164. algopipe-0.1.0/src/algopipe.egg-info/top_level.txt +1 -0
  165. algopipe-0.1.0/tests/test_generator.py +0 -0
algopipe-0.1.0/LICENSE ADDED
File without changes
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.4
2
+ Name: algopipe
3
+ Version: 0.1.0
4
+ Summary: Interactive CLI to generate ML/DL pipelines.
5
+ Author-email: Dhruv Mittal <mittaldhruv41@gmail.com>
6
+ License: MIT
7
+ Requires-Python: >=3.8
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: questionary
11
+ Requires-Dist: rich
12
+ Requires-Dist: black
13
+ Dynamic: license-file
File without changes
@@ -0,0 +1,20 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "algopipe"
7
+ version = "0.1.0"
8
+ description = "Interactive CLI to generate ML/DL pipelines."
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = {text = "MIT"}
12
+ authors = [{name = "Dhruv Mittal", email = "mittaldhruv41@gmail.com"}]
13
+ dependencies = [
14
+ "questionary", # For interactive menus
15
+ "rich", # For pretty printing
16
+ "black", # For formatting generated code
17
+ ]
18
+
19
+ [project.scripts]
20
+ AlgoPipe = "AlgoPipe.cli:main" # This allows users to type 'aitool' in terminal
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
File without changes
@@ -0,0 +1,76 @@
1
+ import sys
2
+ import os
3
+ import questionary
4
+ from rich.console import Console
5
+ from rich.panel import Panel
6
+ import AlgoPipe.modules
7
+ from AlgoPipe.registry import Registry
8
+ from AlgoPipe.generator import PipelineGenerator
9
+
10
+ console = Console()
11
+
12
+ def main():
13
+ console.print(Panel.fit("AI Tool - Interactive Pipeline Builder", style="bold blue"))
14
+
15
+ generator = PipelineGenerator()
16
+
17
+ while True:
18
+
19
+ categories = Registry.get_categories()
20
+ category = questionary.select(
21
+ "What would you like to add next?",
22
+ choices=categories + ["Done (Generate Code)", "Exit"]
23
+ ).ask()
24
+
25
+ if category == "Exit":
26
+ sys.exit()
27
+ if category == "Done (Generate Code)":
28
+ break
29
+
30
+
31
+ subcategories = Registry.get_subcategories(category)
32
+
33
+
34
+ if len(subcategories) == 1:
35
+ subcategory = subcategories[0]
36
+ else:
37
+ subcategory = questionary.select(
38
+ f"Select a type of {category}:",
39
+ choices=subcategories
40
+ ).ask()
41
+
42
+
43
+ modules = Registry.get_modules(category, subcategory)
44
+ if not modules:
45
+ console.print(f"[yellow]No modules found.[/yellow]")
46
+ continue
47
+
48
+ module_name = questionary.select(
49
+ f"Choose algorithm:",
50
+ choices=modules
51
+ ).ask()
52
+
53
+
54
+ module_instance = Registry.get_module(category, subcategory, module_name)
55
+ generator.add_step(module_instance)
56
+ console.print(f"[green]Added {module_name} to pipeline.[/green]")
57
+
58
+
59
+ output_filename = questionary.text("Output filename:", default="pipeline.py").ask()
60
+
61
+ code = generator.generate_code()
62
+
63
+
64
+ try:
65
+ import black
66
+ code = black.format_str(code, mode=black.Mode())
67
+ except ImportError:
68
+ pass
69
+
70
+ with open(output_filename, "w") as f:
71
+ f.write(code)
72
+
73
+ console.print(Panel(f"Successfully generated pipeline at [bold]{os.path.abspath(output_filename)}[/bold]", style="green"))
74
+
75
+ if __name__ == "__main__":
76
+ main()
File without changes
File without changes
@@ -0,0 +1,43 @@
1
+ from typing import List, Tuple
2
+ from AlgoPipe.registry import BaseModule
3
+
4
+ class PipelineGenerator:
5
+ def __init__(self):
6
+ self.pipeline: List[BaseModule] = []
7
+
8
+ def add_step(self, module: BaseModule):
9
+ self.pipeline.append(module)
10
+
11
+ def generate_code(self) -> str:
12
+ all_imports = set()
13
+ code_blocks = []
14
+
15
+
16
+ for module in self.pipeline:
17
+ all_imports.update(module.get_imports())
18
+ code_blocks.append(module.get_code())
19
+
20
+
21
+ imports_str = "\n".join(sorted(list(all_imports)))
22
+
23
+ body_str = "\n\n".join(code_blocks)
24
+
25
+
26
+ full_script = (
27
+ f"# Generated by AI Tool\n"
28
+ f"import pandas as pd\n"
29
+ f"import numpy as np\n"
30
+ f"{imports_str}\n\n"
31
+ f"def main():\n"
32
+ f" # Load your data here (Placeholder)\n"
33
+ f" df = pd.read_csv('data.csv')\n\n"
34
+ f"{self._indent_code(body_str)}\n\n"
35
+ f"if __name__ == '__main__':\n"
36
+ f" main()"
37
+ )
38
+ return full_script
39
+
40
+ def _indent_code(self, code: str, spaces=4) -> str:
41
+ """Helper to indent the generated body code."""
42
+ indentation = " " * spaces
43
+ return "\n".join([f"{indentation}{line}" if line else line for line in code.split('\n')])
@@ -0,0 +1,29 @@
1
+ from AlgoPipe.registry import Registry, BaseModule
2
+
3
+ @Registry.register("DL_Algorithms",subcategory="Basic_NN")
4
+ class Backpropagation(BaseModule):
5
+ name = "Backpropagation"
6
+ description = "Backpropagation Algorithm for training neural networks"
7
+
8
+ def get_imports(self):
9
+ return [
10
+ "import numpy as np"
11
+ ]
12
+
13
+ def get_code(self, variable_name="model"):
14
+ return (
15
+ f"# Backpropagation Algorithm\n"
16
+ f"def backpropagation(X, y, weights, learning_rate=0.01):\n"
17
+ f" # Forward pass\n"
18
+ f" outputs = np.dot(X, weights)\n"
19
+ f" predictions = 1 / (1 + np.exp(-outputs)) # Sigmoid activation\n\n"
20
+ f" # Compute error\n"
21
+ f" error = predictions - y\n\n"
22
+ f" # Backward pass (compute gradients)\n"
23
+ f" gradients = np.dot(X.T, error) / len(X)\n\n"
24
+ f" # Update weights\n"
25
+ f" weights -= learning_rate * gradients\n\n"
26
+ f" return weights"
27
+ f"# Example usage\n"
28
+ f"{variable_name} = backpropagation(X, y, weights)"
29
+ )
@@ -0,0 +1,22 @@
1
+ from AlgoPipe.registry import Registry, BaseModule
2
+
3
+ @Registry.register("DL_Algorithms",subcategory="Basic_NN")
4
+ class MultiLayerPerceptron(BaseModule):
5
+ name = "Multi-Layer Perceptron"
6
+ description = "Multi-Layer Perceptron (MLP) implementation using scikit-learn"
7
+
8
+ def get_imports(self):
9
+ return [
10
+ "from sklearn.neural_network import MLPClassifier",
11
+ "from sklearn.metrics import accuracy_score"
12
+ ]
13
+
14
+ def get_code(self, variable_name="model"):
15
+ return (
16
+ f"# Initialize and Train Model\n"
17
+ f"{variable_name} = MLPClassifier(hidden_layer_sizes=(100,), max_iter=300, random_state=42)\n"
18
+ f"{variable_name}.fit(X_train, y_train)\n\n"
19
+ f"# Predictions\n"
20
+ f"preds = {variable_name}.predict(X_test)\n"
21
+ f"print(f'Accuracy: {{accuracy_score(y_test, preds)}}')"
22
+ )
@@ -0,0 +1,27 @@
1
+ from AlgoPipe.registry import Registry, BaseModule
2
+
3
+ @Registry.register("DL_Algorithms",subcategory="Basic_NN")
4
+ class Perceptron(BaseModule):
5
+ name = "Perceptron"
6
+ description = "Perceptron Algorithm for binary classification"
7
+
8
+ def get_imports(self):
9
+ return [
10
+ "import numpy as np"
11
+ ]
12
+
13
+ def get_code(self, variable_name="model"):
14
+ return (
15
+ f"# Perceptron Algorithm\n"
16
+ f"def perceptron(X, y, weights, learning_rate=0.01, epochs=1000):\n"
17
+ f" for epoch in range(epochs):\n"
18
+ f" for i in range(len(X)):\n"
19
+ f" linear_output = np.dot(X[i], weights)\n"
20
+ f" predicted = 1 if linear_output >= 0 else 0\n\n"
21
+ f" # Update weights\n"
22
+ f" update = learning_rate * (y[i] - predicted)\n"
23
+ f" weights += update * X[i]\n\n"
24
+ f" return weights\n\n"
25
+ f"# Example usage\n"
26
+ f"{variable_name} = perceptron(X, y, weights)"
27
+ )
@@ -0,0 +1,63 @@
1
+ from AlgoPipe.registry import Registry, BaseModule
2
+
3
+ @Registry.register("DL_Algorithms",subcategory="Convolutional_NN")
4
+ class AlexNet(BaseModule):
5
+ name = "AlexNet"
6
+ description = "AlexNet architecture for image classification"
7
+
8
+ def get_imports(self):
9
+ return [
10
+ "import torch",
11
+ "import torch.nn as nn",
12
+ "import torch.optim as optim",
13
+ "from torchvision import datasets, transforms"
14
+ ]
15
+
16
+ def get_code(self, variable_name="model"):
17
+ return (
18
+ f"# Define AlexNet Architecture\n"
19
+ f"class AlexNet(nn.Module):\n"
20
+ f" def __init__(self, num_classes=1000):\n"
21
+ f" super(AlexNet, self).__init__()\n"
22
+ f" self.features = nn.Sequential(\n"
23
+ f" nn.Conv2d(3, 96, kernel_size=11, stride=4),\n"
24
+ f" nn.ReLU(inplace=True),\n"
25
+ f" nn.MaxPool2d(kernel_size=3, stride=2),\n"
26
+ f" nn.Conv2d(96, 256, kernel_size=5, padding=2),\n"
27
+ f" nn.ReLU(inplace=True),\n"
28
+ f" nn.MaxPool2d(kernel_size=3, stride=2),\n"
29
+ f" nn.Conv2d(256, 384, kernel_size=3, padding=1),\n"
30
+ f" nn.ReLU(inplace=True),\n"
31
+ f" nn.Conv2d(384, 384, kernel_size=3, padding=1),\n"
32
+ f" nn.ReLU(inplace=True),\n"
33
+ f" nn.Conv2d(384, 256, kernel_size=3, padding=1),\n"
34
+ f" nn.ReLU(inplace=True),\n"
35
+ f" nn.MaxPool2d(kernel_size=3, stride=2)\n"
36
+ f" )\n\n"
37
+ f" self.classifier = nn.Sequential(\n"
38
+ f" nn.Dropout(),\n"
39
+ f" nn.Linear(256 * 6 * 6, 4096),\n"
40
+ f" nn.ReLU(inplace=True),\n"
41
+ f" nn.Dropout(),\n"
42
+ f" nn.Linear(4096, 4096),\n"
43
+ f" nn.ReLU(inplace=True),\n"
44
+ f" nn.Linear(4096, num_classes)\n"
45
+ f" )\n\n"
46
+ f" def forward(self, x):\n"
47
+ f" x = self.features(x)\n"
48
+ f" x = x.view(x.size(0), 256 * 6 * 6)\n"
49
+ f" x = self.classifier(x)\n"
50
+ f" return x\n\n"
51
+ f"# Initialize Model\n"
52
+ f"{variable_name} = AlexNet(num_classes=1000)\n\n"
53
+ f"# Example Training Loop\n"
54
+ f"criterion = nn.CrossEntropyLoss()\n"
55
+ f"optimizer = optim.SGD({variable_name}.parameters(), lr=0.01, momentum=0.9)\n\n"
56
+ f"for epoch in range(10):\n"
57
+ f" for inputs, labels in train_loader:\n"
58
+ f" optimizer.zero_grad()\n"
59
+ f" outputs = {variable_name}(inputs)\n"
60
+ f" loss = criterion(outputs, labels)\n"
61
+ f" loss.backward()\n"
62
+ f" optimizer.step()\n"
63
+ )
@@ -0,0 +1,40 @@
1
+ from AlgoPipe.registry import Registry, BaseModule
2
+
3
+ @Registry.register("DL_Algorithms",subcategory="Convolutional_NN")
4
+ class ConvNEXt(BaseModule):
5
+ name = "ConvNEXt"
6
+ description = "ConvNEXt: A modernized convolutional neural network architecture"
7
+
8
+ def get_imports(self):
9
+ return [
10
+ "import torch",
11
+ "import torch.nn as nn",
12
+ "import torch.nn.functional as F"
13
+ ]
14
+
15
+ def get_code(self, variable_name="model"):
16
+ return (
17
+ f"# ConvNEXt Architecture\n"
18
+ f"class ConvNEXt(nn.Module):\n"
19
+ f" def __init__(self, num_classes=10):\n"
20
+ f" super(ConvNEXt, self).__init__()\n"
21
+ f" self.conv1 = nn.Conv2d(3, 64, kernel_size=3, padding=1)\n"
22
+ f" self.conv2 = nn.Conv2d(64, 128, kernel_size=3, padding=1)\n"
23
+ f" self.conv3 = nn.Conv2d(128, 256, kernel_size=3, padding=1)\n"
24
+ f" self.pool = nn.MaxPool2d(2, 2)\n"
25
+ f" self.fc1 = nn.Linear(256 * 4 * 4, 512)\n"
26
+ f" self.fc2 = nn.Linear(512, num_classes)\n\n"
27
+ f" def forward(self, x):\n"
28
+ f" x = F.relu(self.conv1(x))\n"
29
+ f" x = self.pool(x)\n"
30
+ f" x = F.relu(self.conv2(x))\n"
31
+ f" x = self.pool(x)\n"
32
+ f" x = F.relu(self.conv3(x))\n"
33
+ f" x = self.pool(x)\n"
34
+ f" x = x.view(-1, 256 * 4 * 4)\n"
35
+ f" x = F.relu(self.fc1(x))\n"
36
+ f" x = self.fc2(x)\n"
37
+ f" return x\n\n"
38
+ f"# Initialize model\n"
39
+ f"{variable_name} = ConvNEXt(num_classes=10)"
40
+ )
@@ -0,0 +1,57 @@
1
+ from AlgoPipe.registry import Registry, BaseModule
2
+
3
+ @Registry.register("DL_Algorithms",subcategory="Convolutional_NN")
4
+ class DenseNet(BaseModule):
5
+ name = "DenseNet"
6
+ description = "DenseNet: Densely Connected Convolutional Networks"
7
+
8
+ def get_imports(self):
9
+ return [
10
+ "import torch",
11
+ "import torch.nn as nn",
12
+ "import torch.nn.functional as F"
13
+ ]
14
+
15
+ def get_code(self, variable_name="model"):
16
+ return (
17
+ f"# DenseNet Architecture\n"
18
+ f"class DenseBlock(nn.Module):\n"
19
+ f" def __init__(self, num_layers, in_channels, growth_rate):\n"
20
+ f" super(DenseBlock, self).__init__()\n"
21
+ f" self.layers = nn.ModuleList()\n"
22
+ f" for i in range(num_layers):\n"
23
+ f" self.layers.append(nn.Sequential(\n"
24
+ f" nn.BatchNorm2d(in_channels + i * growth_rate),\n"
25
+ f" nn.ReLU(inplace=True),\n"
26
+ f" nn.Conv2d(in_channels + i * growth_rate, growth_rate, kernel_size=3, padding=1)\n"
27
+ f" ))\n\n"
28
+ f" def forward(self, x):\n"
29
+ f" features = [x]\n"
30
+ f" for layer in self.layers:\n"
31
+ f" new_feature = layer(torch.cat(features, 1))\n"
32
+ f" features.append(new_feature)\n"
33
+ f" return torch.cat(features, 1)\n\n"
34
+ f"class DenseNet(nn.Module):\n"
35
+ f" def __init__(self, growth_rate=32, num_blocks=4, num_layers_per_block=6, num_classes=10):\n"
36
+ f" super(DenseNet, self).__init__()\n"
37
+ f" self.conv1 = nn.Conv2d(3, growth_rate * 2, kernel_size=7, stride=2, padding=3)\n"
38
+ f" self.pool = nn.MaxPool2d(3, stride=2, padding=1)\n"
39
+ f" self.blocks = nn.ModuleList()\n"
40
+ f" num_channels = growth_rate * 2\n"
41
+ f" for _ in range(num_blocks):\n"
42
+ f" block = DenseBlock(num_layers_per_block, num_channels, growth_rate)\n"
43
+ f" self.blocks.append(block)\n"
44
+ f" num_channels += num_layers_per_block * growth_rate\n"
45
+ f" self.classifier = nn.Linear(num_channels, num_classes)\n\n"
46
+ f" def forward(self, x):\n"
47
+ f" x = self.conv1(x)\n"
48
+ f" x = self.pool(x)\n"
49
+ f" for block in self.blocks:\n"
50
+ f" x = block(x)\n"
51
+ f" x = F.adaptive_avg_pool2d(x, (1, 1))\n"
52
+ f" x = x.view(x.size(0), -1)\n"
53
+ f" x = self.classifier(x)\n"
54
+ f" return x\n\n"
55
+ f"# Initialize model\n"
56
+ f"{variable_name} = DenseNet(growth_rate=32, num_blocks=4, num_layers_per_block=6, num_classes=10)"
57
+ )
@@ -0,0 +1,41 @@
1
+ from AlgoPipe.registry import Registry, BaseModule
2
+
3
+ @Registry.register("DL_Algorithms",subcategory="Convolutional_NN")
4
+ class EfficientNet(BaseModule):
5
+ name = "EfficientNet"
6
+ description = "EfficientNet: A family of convolutional neural networks that achieve high accuracy with fewer parameters"
7
+
8
+ def get_imports(self):
9
+ return [
10
+ "import torch",
11
+ "import torch.nn as nn",
12
+ "import torch.nn.functional as F"
13
+ ]
14
+
15
+ def get_code(self, variable_name="model"):
16
+ return (
17
+ f"# EfficientNet Architecture\n"
18
+ f"class EfficientNet(nn.Module):\n"
19
+ f" def __init__(self, num_classes=10):\n"
20
+ f" super(EfficientNet, self).__init__()\n"
21
+ f" # Define layers here (this is a simplified version)\n"
22
+ f" self.conv1 = nn.Conv2d(3, 32, kernel_size=3, padding=1)\n"
23
+ f" self.conv2 = nn.Conv2d(32, 64, kernel_size=3, padding=1)\n"
24
+ f" self.conv3 = nn.Conv2d(64, 128, kernel_size=3, padding=1)\n"
25
+ f" self.pool = nn.MaxPool2d(2, 2)\n"
26
+ f" self.fc1 = nn.Linear(128 * 4 * 4, 512)\n"
27
+ f" self.fc2 = nn.Linear(512, num_classes)\n\n"
28
+ f" def forward(self, x):\n"
29
+ f" x = F.relu(self.conv1(x))\n"
30
+ f" x = self.pool(x)\n"
31
+ f" x = F.relu(self.conv2(x))\n"
32
+ f" x = self.pool(x)\n"
33
+ f" x = F.relu(self.conv3(x))\n"
34
+ f" x = self.pool(x)\n"
35
+ f" x = x.view(-1, 128 * 4 * 4)\n"
36
+ f" x = F.relu(self.fc1(x))\n"
37
+ f" x = self.fc2(x)\n"
38
+ f" return x\n\n"
39
+ f"# Initialize model\n"
40
+ f"{variable_name} = EfficientNet(num_classes=10)"
41
+ )
@@ -0,0 +1,87 @@
1
+ from AlgoPipe.registry import Registry, BaseModule
2
+
3
+ @Registry.register("DL_Algorithms",subcategory="Convolutional_NN")
4
+ class GoogLeNet(BaseModule):
5
+ name = "GoogLeNet"
6
+ description = "GoogLeNet (Inception v1) architecture for image classification"
7
+
8
+ def get_imports(self):
9
+ return [
10
+ "import torch",
11
+ "import torch.nn as nn",
12
+ "import torch.nn.functional as F"
13
+ ]
14
+
15
+ def get_code(self, variable_name="model"):
16
+ return (
17
+ f"# GoogLeNet Architecture\n"
18
+ f"class Inception(nn.Module):\n"
19
+ f" def __init__(self, in_channels, out1x1, out3x3red, out3x3, out5x5red, out5x5, pool_proj):\n"
20
+ f" super(Inception, self).__init__()\n"
21
+ f" self.branch1 = nn.Conv2d(in_channels, out1x1, kernel_size=1)\n"
22
+ f" self.branch2 = nn.Sequential(\n"
23
+ f" nn.Conv2d(in_channels, out3x3red, kernel_size=1),\n"
24
+ f" nn.Conv2d(out3x3red, out3x3, kernel_size=3, padding=1)\n"
25
+ f" )\n"
26
+ f" self.branch3 = nn.Sequential(\n"
27
+ f" nn.Conv2d(in_channels, out5x5red, kernel_size=1),\n"
28
+ f" nn.Conv2d(out5x5red, out5x5, kernel_size=5, padding=2)\n"
29
+ f" )\n"
30
+ f" self.branch4 = nn.Sequential(\n"
31
+ f" nn.MaxPool2d(kernel_size=3, stride=1, padding=1),\n"
32
+ f" nn.Conv2d(in_channels, pool_proj, kernel_size=1)\n"
33
+ f" )\n\n"
34
+ f" def forward(self, x):\n"
35
+ f" branch1 = F.relu(self.branch1(x))\n"
36
+ f" branch2 = F.relu(self.branch2(x))\n"
37
+ f" branch3 = F.relu(self.branch3(x))\n"
38
+ f" branch4 = F.relu(self.branch4(x))\n"
39
+ f" outputs = [branch1, branch2, branch3, branch4]\n"
40
+ f" return torch.cat(outputs, 1)\n\n"
41
+ f"class GoogLeNet(nn.Module):\n"
42
+ f" def __init__(self, num_classes=1000):\n"
43
+ f" super(GoogLeNet, self).__init__()\n"
44
+ f" self.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3)\n"
45
+ f" self.maxpool1 = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)\n"
46
+ f" self.conv2 = nn.Conv2d(64, 64, kernel_size=1)\n"
47
+ f" self.conv3 = nn.Conv2d(64, 192, kernel_size=3, padding=1)\n"
48
+ f" self.maxpool2 = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)\n"
49
+ f" self.inception3a = Inception(192, 64, 96, 128, 16, 32, 32)\n"
50
+ f" self.inception3b = Inception(256, 128, 128, 192, 32, 96, 64)\n"
51
+ f" self.maxpool3 = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)\n"
52
+ f" self.inception4a = Inception(480, 192, 96, 208, 16, 48, 64)\n"
53
+ f" self.inception4b = Inception(512, 160, 112, 224, 24, 64, 64)\n"
54
+ f" self.inception4c = Inception(512, 128, 128, 256, 24, 64, 64)\n"
55
+ f" self.inception4d = Inception(512, 112, 144, 288, 32, 64, 64)\n"
56
+ f" self.inception4e = Inception(528, 256, 160, 320, 32, 128, 128)\n"
57
+ f" self.maxpool4 = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)\n"
58
+ f" self.inception5a = Inception(832, 256, 160, 320, 32, 128, 128)\n"
59
+ f" self.inception5b = Inception(832, 384, 192, 384, 48, 128, 128)\n"
60
+ f" self.avgpool = nn.AdaptiveAvgPool2d((1, 1))\n"
61
+ f" self.dropout = nn.Dropout(0.4)\n"
62
+ f" self.fc = nn.Linear(1024, num_classes)\n\n"
63
+ f" def forward(self, x):\n"
64
+ f" x = F.relu(self.conv1(x))\n"
65
+ f" x = self.maxpool1(x)\n"
66
+ f" x = F.relu(self.conv2(x))\n"
67
+ f" x = F.relu(self.conv3(x))\n"
68
+ f" x = self.maxpool2(x)\n"
69
+ f" x = self.inception3a(x)\n"
70
+ f" x = self.inception3b(x)\n"
71
+ f" x = self.maxpool3(x)\n"
72
+ f" x = self.inception4a(x)\n"
73
+ f" x = self.inception4b(x)\n"
74
+ f" x = self.inception4c(x)\n"
75
+ f" x = self.inception4d(x)\n"
76
+ f" x = self.inception4e(x)\n"
77
+ f" x = self.maxpool4(x)\n"
78
+ f" x = self.inception5a(x)\n"
79
+ f" x = self.inception5b(x)\n"
80
+ f" x = self.avgpool(x)\n"
81
+ f" x = x.view(x.size(0), -1)\n"
82
+ f" x = self.dropout(x)\n"
83
+ f" x = self.fc(x)\n"
84
+ f" return x\n\n"
85
+ f"# Initialize model\n"
86
+ f"{variable_name} = GoogLeNet(num_classes=1000)"
87
+ )
@@ -0,0 +1,39 @@
1
+ from AlgoPipe.registry import Registry, BaseModule
2
+
3
+ @Registry.register("DL_Algorithms",subcategory="Convolutional_NN")
4
+ class LeNet(BaseModule):
5
+ name = "LeNet"
6
+ description = "LeNet-5: A pioneering convolutional neural network architecture for digit recognition"
7
+
8
+ def get_imports(self):
9
+ return [
10
+ "import torch",
11
+ "import torch.nn as nn",
12
+ "import torch.nn.functional as F"
13
+ ]
14
+
15
+ def get_code(self, variable_name="model"):
16
+ return (
17
+ f"# LeNet-5 Architecture\n"
18
+ f"class LeNet(nn.Module):\n"
19
+ f" def __init__(self, num_classes=10):\n"
20
+ f" super(LeNet, self).__init__()\n"
21
+ f" self.conv1 = nn.Conv2d(1, 6, kernel_size=5)\n"
22
+ f" self.conv2 = nn.Conv2d(6, 16, kernel_size=5)\n"
23
+ f" self.pool = nn.AvgPool2d(2, 2)\n"
24
+ f" self.fc1 = nn.Linear(16 * 4 * 4, 120)\n"
25
+ f" self.fc2 = nn.Linear(120, 84)\n"
26
+ f" self.fc3 = nn.Linear(84, num_classes)\n\n"
27
+ f" def forward(self, x):\n"
28
+ f" x = F.relu(self.conv1(x))\n"
29
+ f" x = self.pool(x)\n"
30
+ f" x = F.relu(self.conv2(x))\n"
31
+ f" x = self.pool(x)\n"
32
+ f" x = x.view(-1, 16 * 4 * 4)\n"
33
+ f" x = F.relu(self.fc1(x))\n"
34
+ f" x = F.relu(self.fc2(x))\n"
35
+ f" x = self.fc3(x)\n"
36
+ f" return x\n\n"
37
+ f"# Initialize model\n"
38
+ f"{variable_name} = LeNet(num_classes=10)"
39
+ )
@@ -0,0 +1,38 @@
1
+ from AlgoPipe.registry import Registry, BaseModule
2
+
3
+ @Registry.register("DL_Algorithms",subcategory="Convolutional_NN")
4
+ class MobileNet(BaseModule):
5
+ name = "MobileNet"
6
+ description = "MobileNet: A lightweight convolutional neural network architecture for mobile and embedded vision applications"
7
+
8
+ def get_imports(self):
9
+ return [
10
+ "import torch",
11
+ "import torch.nn as nn",
12
+ "import torch.nn.functional as F"
13
+ ]
14
+
15
+ def get_code(self, variable_name="model"):
16
+ return (
17
+ f"# MobileNet Architecture\n"
18
+ f"class MobileNet(nn.Module):\n"
19
+ f" def __init__(self, num_classes=10):\n"
20
+ f" super(MobileNet, self).__init__()\n"
21
+ f" self.conv1 = nn.Conv2d(3, 32, kernel_size=3, stride=2, padding=1)\n"
22
+ f" self.conv2 = nn.Conv2d(32, 64, kernel_size=3, stride=1, padding=1)\n"
23
+ f" self.conv3 = nn.Conv2d(64, 128, kernel_size=3, stride=2, padding=1)\n"
24
+ f" self.conv4 = nn.Conv2d(128, 256, kernel_size=3, stride=1, padding=1)\n"
25
+ f" self.pool = nn.AdaptiveAvgPool2d((1, 1))\n"
26
+ f" self.fc = nn.Linear(256, num_classes)\n\n"
27
+ f" def forward(self, x):\n"
28
+ f" x = F.relu(self.conv1(x))\n"
29
+ f" x = F.relu(self.conv2(x))\n"
30
+ f" x = F.relu(self.conv3(x))\n"
31
+ f" x = F.relu(self.conv4(x))\n"
32
+ f" x = self.pool(x)\n"
33
+ f" x = x.view(-1, 256)\n"
34
+ f" x = self.fc(x)\n"
35
+ f" return x\n\n"
36
+ f"# Initialize model\n"
37
+ f"{variable_name} = MobileNet(num_classes=10)"
38
+ )