PyIntell 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.
- pyintell-0.1.0/LICENSE +21 -0
- pyintell-0.1.0/PKG-INFO +226 -0
- pyintell-0.1.0/README.md +195 -0
- pyintell-0.1.0/pyproject.toml +46 -0
- pyintell-0.1.0/setup.cfg +4 -0
- pyintell-0.1.0/src/PyIntell.egg-info/PKG-INFO +226 -0
- pyintell-0.1.0/src/PyIntell.egg-info/SOURCES.txt +28 -0
- pyintell-0.1.0/src/PyIntell.egg-info/dependency_links.txt +1 -0
- pyintell-0.1.0/src/PyIntell.egg-info/requires.txt +4 -0
- pyintell-0.1.0/src/PyIntell.egg-info/top_level.txt +1 -0
- pyintell-0.1.0/src/pyintell/__init__.py +31 -0
- pyintell-0.1.0/src/pyintell/attention.py +126 -0
- pyintell-0.1.0/src/pyintell/autograd.py +50 -0
- pyintell-0.1.0/src/pyintell/builder.py +211 -0
- pyintell-0.1.0/src/pyintell/embeddings.py +33 -0
- pyintell-0.1.0/src/pyintell/finetuning.py +29 -0
- pyintell-0.1.0/src/pyintell/focus.py +81 -0
- pyintell-0.1.0/src/pyintell/generation.py +73 -0
- pyintell-0.1.0/src/pyintell/layers.py +75 -0
- pyintell-0.1.0/src/pyintell/loss.py +39 -0
- pyintell-0.1.0/src/pyintell/model.py +224 -0
- pyintell-0.1.0/src/pyintell/optim.py +94 -0
- pyintell-0.1.0/src/pyintell/quantization.py +25 -0
- pyintell-0.1.0/src/pyintell/scheduling.py +16 -0
- pyintell-0.1.0/src/pyintell/serialization.py +313 -0
- pyintell-0.1.0/src/pyintell/system.py +122 -0
- pyintell-0.1.0/src/pyintell/tokenization.py +147 -0
- pyintell-0.1.0/src/pyintell/training.py +15 -0
- pyintell-0.1.0/src/pyintell/transformer.py +90 -0
- pyintell-0.1.0/src/pyintell/utilities.py +444 -0
pyintell-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Leila150
|
|
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.
|
pyintell-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: PyIntell
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A modular NumPy-based Python framework for building, training, evaluating, and generating from AI models
|
|
5
|
+
Author: Leila150
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Leila150/PyIntell
|
|
8
|
+
Project-URL: Repository, https://github.com/Leila150/PyIntell
|
|
9
|
+
Project-URL: Issues, https://github.com/Leila150/PyIntell/issues
|
|
10
|
+
Keywords: ai,machine-learning,deep-learning,transformer,neural-network,nlp,numpy
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Operating System :: OS Independent
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Requires-Python: >=3.9
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: numpy>=1.24
|
|
28
|
+
Provides-Extra: system
|
|
29
|
+
Requires-Dist: psutil>=5.9; extra == "system"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# PyIntell
|
|
33
|
+
|
|
34
|
+
**PyIntell** is a modular NumPy-based Python framework for building, experimenting with, evaluating, training, and generating from AI/Transformer-style models.
|
|
35
|
+
|
|
36
|
+
> **Status:** `0.1.0` — Alpha. The public API is available for experimentation. Some advanced training, autograd, quantization, and hardware features are lightweight/experimental rather than production-grade.
|
|
37
|
+
|
|
38
|
+
## Installation
|
|
39
|
+
|
|
40
|
+
The **PyPI project name is `PyIntell`**.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pip install PyIntell
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The Python import name is **`pyintell`**:
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
import pyintell
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
This distinction is important: **install `PyIntell`, import `pyintell`.**
|
|
53
|
+
|
|
54
|
+
## Quick start
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
import pyintell
|
|
58
|
+
|
|
59
|
+
model = pyintell.build(
|
|
60
|
+
vocab={"hello": 0, "world": 1},
|
|
61
|
+
reverse_vocab={0: "hello", 1: "world"},
|
|
62
|
+
dataset=[[0, 1]],
|
|
63
|
+
parameters=100_000,
|
|
64
|
+
focus=["coding", "reasoning", "math"],
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
print(model.summary())
|
|
68
|
+
print(model.generate("hello"))
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Main builder
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
pyintell.build(
|
|
75
|
+
vocab,
|
|
76
|
+
reverse_vocab,
|
|
77
|
+
dataset,
|
|
78
|
+
parameters,
|
|
79
|
+
focus,
|
|
80
|
+
dtype=None,
|
|
81
|
+
settings=None,
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`build()` constructs a `Model` from a vocabulary, reverse vocabulary, dataset, requested parameter count, focus, numerical dtype, and optional settings.
|
|
86
|
+
|
|
87
|
+
## Focus system
|
|
88
|
+
|
|
89
|
+
Focus profiles are exposed through `SUPPORTED_FOCUSES` and `FOCUS_PROFILES`. Focus utilities include:
|
|
90
|
+
|
|
91
|
+
- `normalize_focus()`
|
|
92
|
+
- `build_focus_config()`
|
|
93
|
+
- `focus_description()`
|
|
94
|
+
|
|
95
|
+
Multiple focuses are supported:
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
focus=["coding", "reasoning", "math"]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Models can also expose and modify focus through `get_focus()`, `set_focus()`, `focus_scores()`, and `focus_info()`.
|
|
102
|
+
|
|
103
|
+
## Public API
|
|
104
|
+
|
|
105
|
+
The `PyIntell` distribution exposes the Python package `pyintell`. Its public API includes the following functional areas.
|
|
106
|
+
|
|
107
|
+
### Model and building
|
|
108
|
+
|
|
109
|
+
`Model`, `build`, `named_parameters`, `parameter_count`, `parameters_info`, `summary`, `model_info`, `model_size`, `count_parameters`, `parameter_shapes`, `set_current_model`, and model-management helpers.
|
|
110
|
+
|
|
111
|
+
### Tokenization
|
|
112
|
+
|
|
113
|
+
`tokenizer`, `tokenize`, `tokenize_batch`, `detokenize`, `detokenize_batch`, `vocab`, `build_vocab`, `update_vocab`, `merge_vocab`, `reverse_vocab`, `vocab_size`, `token_id`, `id_token`, `token_exists`, `add_token`, `remove_token`, `special_tokens`, `add_special_token`, `encode`, `encode_batch`, `decode`, `decode_batch`, `normalize_text`, `clean_text`, `split_text`, `split_words`, `split_sentences`, `chunk_text`, `truncate`, `truncate_text`, `lower_text`, `uppercase`, and `pad_sequence`.
|
|
114
|
+
|
|
115
|
+
### Embeddings
|
|
116
|
+
|
|
117
|
+
`embedding`, `embeddings`, `positional_embedding`, `position_embedding`, `sinusoidal_embedding`, `rotary_embedding`, and `embedding_similarity`.
|
|
118
|
+
|
|
119
|
+
### Attention and Transformer
|
|
120
|
+
|
|
121
|
+
`attention`, `scaled_dot_product_attention`, `self_attention`, `cross_attention`, `multihead_attention`, `multi_query_attention`, `grouped_query_attention`, `causal_attention`, `local_attention`, `global_attention`, `sparse_attention`, `sliding_window_attention`, `block_attention`, `flash_attention`, `rotary_attention`, `alibi_attention`, `attention_mask`, `causal_mask`, `padding_mask`, `transformer_block`, and `transformer`.
|
|
122
|
+
|
|
123
|
+
### Layers and activations
|
|
124
|
+
|
|
125
|
+
`linear`, `activation`, `relu`, `gelu`, `sigmoid`, `tanh`, `leaky_relu`, `softplus`, `silu`, `swish`, `mish`, `softmax`, `log_softmax`, `layer_norm`, `batch_norm`, `rms_norm`, `dropout`, `flatten_layer`, `feedforward`, `mlp`, `residual`, and `residual_block`.
|
|
126
|
+
|
|
127
|
+
### Losses and metrics
|
|
128
|
+
|
|
129
|
+
`loss`, `cross_entropy`, `binary_cross_entropy`, `mse`, `mae`, `huber_loss`, `kl_divergence`, `contrastive_loss`, `label_smoothing`, `perplexity`, `accuracy`, `f1_score`, and `recall`.
|
|
130
|
+
|
|
131
|
+
### Tensor and numerical operations
|
|
132
|
+
|
|
133
|
+
`tensor`, `zeros`, `ones`, `full`, `random`, `randn`, `randint`, `arange`, `reshape`, `flatten`, `squeeze`, `unsqueeze`, `transpose`, `permute`, `repeat`, `expand`, `pad`, `roll`, `cat`, `stack`, `split`, `chunk`, `matmul`, `dot`, `sum`, `mean`, `max`, `min`, `argmax`, `argmin`, `clip`, `sqrt`, `exp`, `log`, `abs`, `power`, `norm`, `normalize`, `einsum`, `where`, `masked_fill`, `gather`, and `scatter`.
|
|
134
|
+
|
|
135
|
+
### Autograd
|
|
136
|
+
|
|
137
|
+
`gradient`, `compute_gradients`, `numerical_gradient`, `backward`, `requires_grad`, `detach`, `no_grad`, and `zero_grad`.
|
|
138
|
+
|
|
139
|
+
### Optimizers and scheduling
|
|
140
|
+
|
|
141
|
+
`Optimizer`, `optimizer`, `sgd`, `adam`, `adamw`, `rmsprop`, `adagrad`, `update_weights`, `step`, `learning_rate`, `weight_decay`, `gradient_clipping`, `lr_scheduler`, `constant_lr`, `linear_decay`, `cosine_decay`, and `warmup`.
|
|
142
|
+
|
|
143
|
+
### Dataset and training
|
|
144
|
+
|
|
145
|
+
`dataset`, `load_dataset`, `save_dataset`, `split_dataset`, `shuffle`, `batch`, `map_dataset`, `filter_dataset`, `cache`, `train`, and `evaluate`.
|
|
146
|
+
|
|
147
|
+
### Generation
|
|
148
|
+
|
|
149
|
+
`generate`, `sample`, `temperature`, `top_k`, `top_p`, `repetition_penalty`, `frequency_penalty`, `presence_penalty`, `stop_at_token`, `get_model`, and `model_run`.
|
|
150
|
+
|
|
151
|
+
### Serialization and storage
|
|
152
|
+
|
|
153
|
+
`save`, `load`, `save_model`, `load_model`, `delete_model`, `edit_model`, `save_weights`, `load_weights`, `state_dict`, `load_state_dict`, `serialize`, `deserialize`, `save_config`, `load_config`, `save_checkpoint`, `load_checkpoint`, `checkpoint`, `export_model`, `import_model`, `save_text`, `load_text`, `read_text`, and `write_text`.
|
|
154
|
+
|
|
155
|
+
### Quantization and fine-tuning
|
|
156
|
+
|
|
157
|
+
`quantization`, `quantize`, `dequantize`, `int4`, `int8`, `float16`, `bfloat16`, `finetune`, `finetuning`, `parameter_efficient_finetuning`, `lora`, `qlora`, `adapter`, `low_rank`, `prefix_tuning`, `prompt_tuning`, `freeze`, `unfreeze`, `freeze_layers`, `unfreeze_layers`, `trainable`, `trainable_parameters`, `prune`, `sparsify`, and `factorize`.
|
|
158
|
+
|
|
159
|
+
### System and devices
|
|
160
|
+
|
|
161
|
+
`device`, `to_device`, `cpu`, `gpu`, `cuda`, `device_count`, `device_info`, `is_gpu_available`, `cpu_info`, `gpu_info`, `cpu_memory`, `gpu_memory`, `memory_info`, `memory_usage`, `free_memory`, `clear_cache`, `ram`, `storage_info`, and `system_info`.
|
|
162
|
+
|
|
163
|
+
### Reproducibility
|
|
164
|
+
|
|
165
|
+
`seed`, `set_seed`, and `random_seed` control random initialization and reproducibility.
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
pyintell.set_seed(42)
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Package layout
|
|
172
|
+
|
|
173
|
+
The project uses a `src` layout. The **distribution name is `PyIntell`**, and the **Python package/import name is `pyintell`**.
|
|
174
|
+
|
|
175
|
+
```text
|
|
176
|
+
PyIntell/
|
|
177
|
+
├── src/
|
|
178
|
+
│ └── pyintell/
|
|
179
|
+
├── .github/
|
|
180
|
+
│ └── workflows/
|
|
181
|
+
│ └── release.yml
|
|
182
|
+
├── pyproject.toml
|
|
183
|
+
├── README.md
|
|
184
|
+
└── LICENSE
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## PyPI publishing
|
|
188
|
+
|
|
189
|
+
PyPI publication is automated through GitHub Actions and PyPI Trusted Publishing.
|
|
190
|
+
|
|
191
|
+
Workflow:
|
|
192
|
+
|
|
193
|
+
```text
|
|
194
|
+
.github/workflows/release.yml
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
The release workflow:
|
|
198
|
+
|
|
199
|
+
1. Checks out the repository.
|
|
200
|
+
2. Sets up Python.
|
|
201
|
+
3. Installs `build` and `twine`.
|
|
202
|
+
4. Builds source and wheel distributions.
|
|
203
|
+
5. Runs `twine check` against the distributions.
|
|
204
|
+
6. Publishes the distributions to the `PyIntell` PyPI project using Trusted Publishing.
|
|
205
|
+
|
|
206
|
+
A GitHub Release with the `published` event triggers the workflow. It can also be started manually with `workflow_dispatch`.
|
|
207
|
+
|
|
208
|
+
## Requirements
|
|
209
|
+
|
|
210
|
+
- Python `>=3.9`
|
|
211
|
+
- NumPy `>=1.24`
|
|
212
|
+
- Optional: `psutil>=5.9` for system-related functionality
|
|
213
|
+
|
|
214
|
+
## Status
|
|
215
|
+
|
|
216
|
+
**pyintell `0.1.0` Alpha**
|
|
217
|
+
|
|
218
|
+
The project is intended for experimentation and development. The Alpha API may evolve before a stable release.
|
|
219
|
+
|
|
220
|
+
## Repository
|
|
221
|
+
|
|
222
|
+
GitHub: https://github.com/Leila150/PyIntell
|
|
223
|
+
|
|
224
|
+
## License
|
|
225
|
+
|
|
226
|
+
MIT License. See `LICENSE` for the full license text.
|
pyintell-0.1.0/README.md
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# PyIntell
|
|
2
|
+
|
|
3
|
+
**PyIntell** is a modular NumPy-based Python framework for building, experimenting with, evaluating, training, and generating from AI/Transformer-style models.
|
|
4
|
+
|
|
5
|
+
> **Status:** `0.1.0` — Alpha. The public API is available for experimentation. Some advanced training, autograd, quantization, and hardware features are lightweight/experimental rather than production-grade.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
The **PyPI project name is `PyIntell`**.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install PyIntell
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The Python import name is **`pyintell`**:
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
import pyintell
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This distinction is important: **install `PyIntell`, import `pyintell`.**
|
|
22
|
+
|
|
23
|
+
## Quick start
|
|
24
|
+
|
|
25
|
+
```python
|
|
26
|
+
import pyintell
|
|
27
|
+
|
|
28
|
+
model = pyintell.build(
|
|
29
|
+
vocab={"hello": 0, "world": 1},
|
|
30
|
+
reverse_vocab={0: "hello", 1: "world"},
|
|
31
|
+
dataset=[[0, 1]],
|
|
32
|
+
parameters=100_000,
|
|
33
|
+
focus=["coding", "reasoning", "math"],
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
print(model.summary())
|
|
37
|
+
print(model.generate("hello"))
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Main builder
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
pyintell.build(
|
|
44
|
+
vocab,
|
|
45
|
+
reverse_vocab,
|
|
46
|
+
dataset,
|
|
47
|
+
parameters,
|
|
48
|
+
focus,
|
|
49
|
+
dtype=None,
|
|
50
|
+
settings=None,
|
|
51
|
+
)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`build()` constructs a `Model` from a vocabulary, reverse vocabulary, dataset, requested parameter count, focus, numerical dtype, and optional settings.
|
|
55
|
+
|
|
56
|
+
## Focus system
|
|
57
|
+
|
|
58
|
+
Focus profiles are exposed through `SUPPORTED_FOCUSES` and `FOCUS_PROFILES`. Focus utilities include:
|
|
59
|
+
|
|
60
|
+
- `normalize_focus()`
|
|
61
|
+
- `build_focus_config()`
|
|
62
|
+
- `focus_description()`
|
|
63
|
+
|
|
64
|
+
Multiple focuses are supported:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
focus=["coding", "reasoning", "math"]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Models can also expose and modify focus through `get_focus()`, `set_focus()`, `focus_scores()`, and `focus_info()`.
|
|
71
|
+
|
|
72
|
+
## Public API
|
|
73
|
+
|
|
74
|
+
The `PyIntell` distribution exposes the Python package `pyintell`. Its public API includes the following functional areas.
|
|
75
|
+
|
|
76
|
+
### Model and building
|
|
77
|
+
|
|
78
|
+
`Model`, `build`, `named_parameters`, `parameter_count`, `parameters_info`, `summary`, `model_info`, `model_size`, `count_parameters`, `parameter_shapes`, `set_current_model`, and model-management helpers.
|
|
79
|
+
|
|
80
|
+
### Tokenization
|
|
81
|
+
|
|
82
|
+
`tokenizer`, `tokenize`, `tokenize_batch`, `detokenize`, `detokenize_batch`, `vocab`, `build_vocab`, `update_vocab`, `merge_vocab`, `reverse_vocab`, `vocab_size`, `token_id`, `id_token`, `token_exists`, `add_token`, `remove_token`, `special_tokens`, `add_special_token`, `encode`, `encode_batch`, `decode`, `decode_batch`, `normalize_text`, `clean_text`, `split_text`, `split_words`, `split_sentences`, `chunk_text`, `truncate`, `truncate_text`, `lower_text`, `uppercase`, and `pad_sequence`.
|
|
83
|
+
|
|
84
|
+
### Embeddings
|
|
85
|
+
|
|
86
|
+
`embedding`, `embeddings`, `positional_embedding`, `position_embedding`, `sinusoidal_embedding`, `rotary_embedding`, and `embedding_similarity`.
|
|
87
|
+
|
|
88
|
+
### Attention and Transformer
|
|
89
|
+
|
|
90
|
+
`attention`, `scaled_dot_product_attention`, `self_attention`, `cross_attention`, `multihead_attention`, `multi_query_attention`, `grouped_query_attention`, `causal_attention`, `local_attention`, `global_attention`, `sparse_attention`, `sliding_window_attention`, `block_attention`, `flash_attention`, `rotary_attention`, `alibi_attention`, `attention_mask`, `causal_mask`, `padding_mask`, `transformer_block`, and `transformer`.
|
|
91
|
+
|
|
92
|
+
### Layers and activations
|
|
93
|
+
|
|
94
|
+
`linear`, `activation`, `relu`, `gelu`, `sigmoid`, `tanh`, `leaky_relu`, `softplus`, `silu`, `swish`, `mish`, `softmax`, `log_softmax`, `layer_norm`, `batch_norm`, `rms_norm`, `dropout`, `flatten_layer`, `feedforward`, `mlp`, `residual`, and `residual_block`.
|
|
95
|
+
|
|
96
|
+
### Losses and metrics
|
|
97
|
+
|
|
98
|
+
`loss`, `cross_entropy`, `binary_cross_entropy`, `mse`, `mae`, `huber_loss`, `kl_divergence`, `contrastive_loss`, `label_smoothing`, `perplexity`, `accuracy`, `f1_score`, and `recall`.
|
|
99
|
+
|
|
100
|
+
### Tensor and numerical operations
|
|
101
|
+
|
|
102
|
+
`tensor`, `zeros`, `ones`, `full`, `random`, `randn`, `randint`, `arange`, `reshape`, `flatten`, `squeeze`, `unsqueeze`, `transpose`, `permute`, `repeat`, `expand`, `pad`, `roll`, `cat`, `stack`, `split`, `chunk`, `matmul`, `dot`, `sum`, `mean`, `max`, `min`, `argmax`, `argmin`, `clip`, `sqrt`, `exp`, `log`, `abs`, `power`, `norm`, `normalize`, `einsum`, `where`, `masked_fill`, `gather`, and `scatter`.
|
|
103
|
+
|
|
104
|
+
### Autograd
|
|
105
|
+
|
|
106
|
+
`gradient`, `compute_gradients`, `numerical_gradient`, `backward`, `requires_grad`, `detach`, `no_grad`, and `zero_grad`.
|
|
107
|
+
|
|
108
|
+
### Optimizers and scheduling
|
|
109
|
+
|
|
110
|
+
`Optimizer`, `optimizer`, `sgd`, `adam`, `adamw`, `rmsprop`, `adagrad`, `update_weights`, `step`, `learning_rate`, `weight_decay`, `gradient_clipping`, `lr_scheduler`, `constant_lr`, `linear_decay`, `cosine_decay`, and `warmup`.
|
|
111
|
+
|
|
112
|
+
### Dataset and training
|
|
113
|
+
|
|
114
|
+
`dataset`, `load_dataset`, `save_dataset`, `split_dataset`, `shuffle`, `batch`, `map_dataset`, `filter_dataset`, `cache`, `train`, and `evaluate`.
|
|
115
|
+
|
|
116
|
+
### Generation
|
|
117
|
+
|
|
118
|
+
`generate`, `sample`, `temperature`, `top_k`, `top_p`, `repetition_penalty`, `frequency_penalty`, `presence_penalty`, `stop_at_token`, `get_model`, and `model_run`.
|
|
119
|
+
|
|
120
|
+
### Serialization and storage
|
|
121
|
+
|
|
122
|
+
`save`, `load`, `save_model`, `load_model`, `delete_model`, `edit_model`, `save_weights`, `load_weights`, `state_dict`, `load_state_dict`, `serialize`, `deserialize`, `save_config`, `load_config`, `save_checkpoint`, `load_checkpoint`, `checkpoint`, `export_model`, `import_model`, `save_text`, `load_text`, `read_text`, and `write_text`.
|
|
123
|
+
|
|
124
|
+
### Quantization and fine-tuning
|
|
125
|
+
|
|
126
|
+
`quantization`, `quantize`, `dequantize`, `int4`, `int8`, `float16`, `bfloat16`, `finetune`, `finetuning`, `parameter_efficient_finetuning`, `lora`, `qlora`, `adapter`, `low_rank`, `prefix_tuning`, `prompt_tuning`, `freeze`, `unfreeze`, `freeze_layers`, `unfreeze_layers`, `trainable`, `trainable_parameters`, `prune`, `sparsify`, and `factorize`.
|
|
127
|
+
|
|
128
|
+
### System and devices
|
|
129
|
+
|
|
130
|
+
`device`, `to_device`, `cpu`, `gpu`, `cuda`, `device_count`, `device_info`, `is_gpu_available`, `cpu_info`, `gpu_info`, `cpu_memory`, `gpu_memory`, `memory_info`, `memory_usage`, `free_memory`, `clear_cache`, `ram`, `storage_info`, and `system_info`.
|
|
131
|
+
|
|
132
|
+
### Reproducibility
|
|
133
|
+
|
|
134
|
+
`seed`, `set_seed`, and `random_seed` control random initialization and reproducibility.
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
pyintell.set_seed(42)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Package layout
|
|
141
|
+
|
|
142
|
+
The project uses a `src` layout. The **distribution name is `PyIntell`**, and the **Python package/import name is `pyintell`**.
|
|
143
|
+
|
|
144
|
+
```text
|
|
145
|
+
PyIntell/
|
|
146
|
+
├── src/
|
|
147
|
+
│ └── pyintell/
|
|
148
|
+
├── .github/
|
|
149
|
+
│ └── workflows/
|
|
150
|
+
│ └── release.yml
|
|
151
|
+
├── pyproject.toml
|
|
152
|
+
├── README.md
|
|
153
|
+
└── LICENSE
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## PyPI publishing
|
|
157
|
+
|
|
158
|
+
PyPI publication is automated through GitHub Actions and PyPI Trusted Publishing.
|
|
159
|
+
|
|
160
|
+
Workflow:
|
|
161
|
+
|
|
162
|
+
```text
|
|
163
|
+
.github/workflows/release.yml
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
The release workflow:
|
|
167
|
+
|
|
168
|
+
1. Checks out the repository.
|
|
169
|
+
2. Sets up Python.
|
|
170
|
+
3. Installs `build` and `twine`.
|
|
171
|
+
4. Builds source and wheel distributions.
|
|
172
|
+
5. Runs `twine check` against the distributions.
|
|
173
|
+
6. Publishes the distributions to the `PyIntell` PyPI project using Trusted Publishing.
|
|
174
|
+
|
|
175
|
+
A GitHub Release with the `published` event triggers the workflow. It can also be started manually with `workflow_dispatch`.
|
|
176
|
+
|
|
177
|
+
## Requirements
|
|
178
|
+
|
|
179
|
+
- Python `>=3.9`
|
|
180
|
+
- NumPy `>=1.24`
|
|
181
|
+
- Optional: `psutil>=5.9` for system-related functionality
|
|
182
|
+
|
|
183
|
+
## Status
|
|
184
|
+
|
|
185
|
+
**pyintell `0.1.0` Alpha**
|
|
186
|
+
|
|
187
|
+
The project is intended for experimentation and development. The Alpha API may evolve before a stable release.
|
|
188
|
+
|
|
189
|
+
## Repository
|
|
190
|
+
|
|
191
|
+
GitHub: https://github.com/Leila150/PyIntell
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
MIT License. See `LICENSE` for the full license text.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77.0.3"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "PyIntell"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A modular NumPy-based Python framework for building, training, evaluating, and generating from AI models"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
authors = [{ name = "Leila150" }]
|
|
12
|
+
license = "MIT"
|
|
13
|
+
license-files = ["LICENSE"]
|
|
14
|
+
keywords = ["ai", "machine-learning", "deep-learning", "transformer", "neural-network", "nlp", "numpy"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Intended Audience :: Science/Research",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
21
|
+
"Programming Language :: Python :: 3.9",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
"Programming Language :: Python :: 3.13",
|
|
26
|
+
"Programming Language :: Python :: 3.14",
|
|
27
|
+
"Operating System :: OS Independent",
|
|
28
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
29
|
+
]
|
|
30
|
+
dependencies = [
|
|
31
|
+
"numpy>=1.24",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.optional-dependencies]
|
|
35
|
+
system = [
|
|
36
|
+
"psutil>=5.9",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Homepage = "https://github.com/Leila150/PyIntell"
|
|
41
|
+
Repository = "https://github.com/Leila150/PyIntell"
|
|
42
|
+
Issues = "https://github.com/Leila150/PyIntell/issues"
|
|
43
|
+
|
|
44
|
+
[tool.setuptools.packages.find]
|
|
45
|
+
where = ["src"]
|
|
46
|
+
include = ["pyintell*"]
|
pyintell-0.1.0/setup.cfg
ADDED