adaiml-tools 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.
- adaiml_tools-0.1.0/LICENSE +21 -0
- adaiml_tools-0.1.0/PKG-INFO +115 -0
- adaiml_tools-0.1.0/README.md +80 -0
- adaiml_tools-0.1.0/pyproject.toml +78 -0
- adaiml_tools-0.1.0/setup.cfg +4 -0
- adaiml_tools-0.1.0/setup.py +27 -0
- adaiml_tools-0.1.0/src/adAI/__init__.py +37 -0
- adaiml_tools-0.1.0/src/adAI/cnn.py +683 -0
- adaiml_tools-0.1.0/src/adAI/core.py +8 -0
- adaiml_tools-0.1.0/src/adAI/mlp.py +402 -0
- adaiml_tools-0.1.0/src/adAI/perceptron.py +363 -0
- adaiml_tools-0.1.0/src/adaiml_tools.egg-info/PKG-INFO +115 -0
- adaiml_tools-0.1.0/src/adaiml_tools.egg-info/SOURCES.txt +16 -0
- adaiml_tools-0.1.0/src/adaiml_tools.egg-info/dependency_links.txt +1 -0
- adaiml_tools-0.1.0/src/adaiml_tools.egg-info/requires.txt +9 -0
- adaiml_tools-0.1.0/src/adaiml_tools.egg-info/top_level.txt +1 -0
- adaiml_tools-0.1.0/tests/test_cnn.py +265 -0
- adaiml_tools-0.1.0/tests/test_core.py +220 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: adaiml-tools
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Python library
|
|
5
|
+
Author: Artheiden
|
|
6
|
+
Author-email: Artheiden <artheidendureza@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/artheidendureza/adAI
|
|
9
|
+
Project-URL: Documentation, https://adAI.readthedocs.io
|
|
10
|
+
Project-URL: Repository, https://github.com/artheidendureza/adAI.git
|
|
11
|
+
Project-URL: Issues, https://github.com/artheidendureza/adAI/issues
|
|
12
|
+
Keywords: adaiml-tools
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: numpy>=1.21.0
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
28
|
+
Requires-Dist: black>=22.0; extra == "dev"
|
|
29
|
+
Requires-Dist: flake8>=5.0; extra == "dev"
|
|
30
|
+
Requires-Dist: isort>=5.0; extra == "dev"
|
|
31
|
+
Requires-Dist: mypy>=0.990; extra == "dev"
|
|
32
|
+
Dynamic: author
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
|
|
36
|
+
# adAI
|
|
37
|
+
|
|
38
|
+
A Python library for making AI/Machine Learning easier and more accessible. Start with simple neural network components like perceptrons and build from there.
|
|
39
|
+
|
|
40
|
+
## Installation
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install adAI
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Or for development:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
git clone https://github.com/yourusername/adAI.git
|
|
50
|
+
cd adAI
|
|
51
|
+
pip install -e ".[dev]"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick Start - Generate a Perceptron
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
import numpy as np
|
|
58
|
+
from adAI import GeneratePerceptron
|
|
59
|
+
|
|
60
|
+
# Create a perceptron with 5 input features
|
|
61
|
+
perceptron = GeneratePerceptron(input_size=5, epochs=100)
|
|
62
|
+
|
|
63
|
+
# Train on your data
|
|
64
|
+
X_train = np.random.randn(100, 5)
|
|
65
|
+
y_train = np.random.randint(0, 2, 100)
|
|
66
|
+
perceptron.train(X_train, y_train)
|
|
67
|
+
|
|
68
|
+
# Make predictions
|
|
69
|
+
predictions = perceptron.predict(X_test)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Features
|
|
73
|
+
|
|
74
|
+
- **GeneratePerceptron()** - Automatically create and initialize a perceptron
|
|
75
|
+
- Multiple activation functions (sigmoid, relu, tanh)
|
|
76
|
+
- Easy training and prediction
|
|
77
|
+
- Built-in loss tracking
|
|
78
|
+
- Growing library of AI components
|
|
79
|
+
|
|
80
|
+
## Configuration Options
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
perceptron = GeneratePerceptron(
|
|
84
|
+
input_size=10, # Number of input features
|
|
85
|
+
learning_rate=0.01, # Learning rate (default: 0.01)
|
|
86
|
+
epochs=100, # Number of training epochs (default: 100)
|
|
87
|
+
activation="sigmoid" # Activation: "sigmoid", "relu", "tanh" (default: "sigmoid")
|
|
88
|
+
)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Documentation
|
|
92
|
+
|
|
93
|
+
For complete documentation, visit [adAI documentation](https://adAI.readthedocs.io).
|
|
94
|
+
|
|
95
|
+
## Testing
|
|
96
|
+
|
|
97
|
+
Run tests with pytest:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pytest
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Run tests with coverage:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
pytest --cov=src/adAI
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Contributing
|
|
110
|
+
|
|
111
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# adAI
|
|
2
|
+
|
|
3
|
+
A Python library for making AI/Machine Learning easier and more accessible. Start with simple neural network components like perceptrons and build from there.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install adAI
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or for development:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
git clone https://github.com/yourusername/adAI.git
|
|
15
|
+
cd adAI
|
|
16
|
+
pip install -e ".[dev]"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start - Generate a Perceptron
|
|
20
|
+
|
|
21
|
+
```python
|
|
22
|
+
import numpy as np
|
|
23
|
+
from adAI import GeneratePerceptron
|
|
24
|
+
|
|
25
|
+
# Create a perceptron with 5 input features
|
|
26
|
+
perceptron = GeneratePerceptron(input_size=5, epochs=100)
|
|
27
|
+
|
|
28
|
+
# Train on your data
|
|
29
|
+
X_train = np.random.randn(100, 5)
|
|
30
|
+
y_train = np.random.randint(0, 2, 100)
|
|
31
|
+
perceptron.train(X_train, y_train)
|
|
32
|
+
|
|
33
|
+
# Make predictions
|
|
34
|
+
predictions = perceptron.predict(X_test)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
- **GeneratePerceptron()** - Automatically create and initialize a perceptron
|
|
40
|
+
- Multiple activation functions (sigmoid, relu, tanh)
|
|
41
|
+
- Easy training and prediction
|
|
42
|
+
- Built-in loss tracking
|
|
43
|
+
- Growing library of AI components
|
|
44
|
+
|
|
45
|
+
## Configuration Options
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
perceptron = GeneratePerceptron(
|
|
49
|
+
input_size=10, # Number of input features
|
|
50
|
+
learning_rate=0.01, # Learning rate (default: 0.01)
|
|
51
|
+
epochs=100, # Number of training epochs (default: 100)
|
|
52
|
+
activation="sigmoid" # Activation: "sigmoid", "relu", "tanh" (default: "sigmoid")
|
|
53
|
+
)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Documentation
|
|
57
|
+
|
|
58
|
+
For complete documentation, visit [adAI documentation](https://adAI.readthedocs.io).
|
|
59
|
+
|
|
60
|
+
## Testing
|
|
61
|
+
|
|
62
|
+
Run tests with pytest:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pytest
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Run tests with coverage:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pytest --cov=src/adAI
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Contributing
|
|
75
|
+
|
|
76
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "adaiml-tools"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A Python library"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Artheiden", email = "artheidendureza@gmail.com"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["adaiml-tools"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.8",
|
|
22
|
+
"Programming Language :: Python :: 3.9",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
]
|
|
26
|
+
dependencies = ["numpy>=1.21.0"]
|
|
27
|
+
|
|
28
|
+
[project.optional-dependencies]
|
|
29
|
+
dev = [
|
|
30
|
+
"pytest>=7.0",
|
|
31
|
+
"pytest-cov>=4.0",
|
|
32
|
+
"black>=22.0",
|
|
33
|
+
"flake8>=5.0",
|
|
34
|
+
"isort>=5.0",
|
|
35
|
+
"mypy>=0.990",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
Homepage = "https://github.com/artheidendureza/adAI"
|
|
40
|
+
Documentation = "https://adAI.readthedocs.io"
|
|
41
|
+
Repository = "https://github.com/artheidendureza/adAI.git"
|
|
42
|
+
Issues = "https://github.com/artheidendureza/adAI/issues"
|
|
43
|
+
|
|
44
|
+
[tool.setuptools]
|
|
45
|
+
package-dir = {"" = "src"}
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.packages.find]
|
|
48
|
+
where = ["src"]
|
|
49
|
+
|
|
50
|
+
[tool.pytest.ini_options]
|
|
51
|
+
testpaths = ["tests"]
|
|
52
|
+
addopts = "--cov=src/adAI --cov-report=html --cov-report=term-missing"
|
|
53
|
+
|
|
54
|
+
[tool.coverage.run]
|
|
55
|
+
branch = true
|
|
56
|
+
|
|
57
|
+
[tool.coverage.report]
|
|
58
|
+
exclude_lines = [
|
|
59
|
+
"pragma: no cover",
|
|
60
|
+
"def __repr__",
|
|
61
|
+
"raise AssertionError",
|
|
62
|
+
"raise NotImplementedError",
|
|
63
|
+
"if __name__ == .__main__.:",
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
[tool.black]
|
|
67
|
+
line-length = 100
|
|
68
|
+
target-version = ['py38']
|
|
69
|
+
|
|
70
|
+
[tool.isort]
|
|
71
|
+
profile = "black"
|
|
72
|
+
line_length = 100
|
|
73
|
+
|
|
74
|
+
[tool.mypy]
|
|
75
|
+
python_version = "3.8"
|
|
76
|
+
warn_return_any = true
|
|
77
|
+
warn_unused_configs = true
|
|
78
|
+
disallow_untyped_defs = false
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
with open("README.md", "r", encoding="utf-8") as f:
|
|
4
|
+
long_description = f.read()
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
name="adaiml-tools",
|
|
8
|
+
version="0.1.0",
|
|
9
|
+
description="A beginner-friendly AI library",
|
|
10
|
+
long_description=long_description,
|
|
11
|
+
long_description_content_type="text/markdown",
|
|
12
|
+
author="Artheiden",
|
|
13
|
+
author_email="artheidendureza@gmail.com",
|
|
14
|
+
license="MIT",
|
|
15
|
+
packages=find_packages(where="src"),
|
|
16
|
+
package_dir={"": "src"},
|
|
17
|
+
python_requires=">=3.9",
|
|
18
|
+
install_requires=["numpy>=1.24"],
|
|
19
|
+
classifiers=[
|
|
20
|
+
"Programming Language :: Python :: 3.9",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"License :: OSI Approved :: MIT License",
|
|
25
|
+
"Operating System :: OS Independent",
|
|
26
|
+
],
|
|
27
|
+
)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""
|
|
2
|
+
adAI - A Python library for making AI easier
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
__version__ = "0.1.0"
|
|
6
|
+
__author__ = "Your Name"
|
|
7
|
+
__email__ = "your.email@example.com"
|
|
8
|
+
|
|
9
|
+
from .perceptron import (
|
|
10
|
+
GeneratePerceptron,
|
|
11
|
+
Perceptron,
|
|
12
|
+
generate_logic_gate_data,
|
|
13
|
+
generate_not_data,
|
|
14
|
+
generate_or_data,
|
|
15
|
+
generate_nor_data,
|
|
16
|
+
generate_and_data,
|
|
17
|
+
generate_nand_data,
|
|
18
|
+
)
|
|
19
|
+
from .mlp import GenerateMLP, GenerateXORMlp, MLP, generate_xor_data
|
|
20
|
+
from .cnn import GenerateCNN, CNN
|
|
21
|
+
|
|
22
|
+
__all__ = [
|
|
23
|
+
'GeneratePerceptron',
|
|
24
|
+
'Perceptron',
|
|
25
|
+
'generate_logic_gate_data',
|
|
26
|
+
'generate_not_data',
|
|
27
|
+
'generate_or_data',
|
|
28
|
+
'generate_nor_data',
|
|
29
|
+
'generate_and_data',
|
|
30
|
+
'generate_nand_data',
|
|
31
|
+
'GenerateMLP',
|
|
32
|
+
'GenerateXORMlp',
|
|
33
|
+
'MLP',
|
|
34
|
+
'generate_xor_data',
|
|
35
|
+
'GenerateCNN',
|
|
36
|
+
'CNN',
|
|
37
|
+
]
|