Metadata-Version: 2.1
Name: netwk
Version: 2.12.2
Summary: Create fast, optimized, and easy-to-use neural networks.
Home-page: https://github.com/flowa-ai/netwk
Author: flowa.ai
Author-email: flowa.dev@gmail.com
Keywords: network,machine learning,ai,neural network
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE

<div align="center"><a href="[https://i.ibb.co/cTyQysp/netwk-back-modified.png](https://i.ibb.co/cTyQysp/netwk-back-modified.png)"><img src="https://i.ibb.co/cTyQysp/netwk-back-modified.png" alt="flowa" border="0" width="430"></a></div>

# [netkw - Neural Network Toolkit](https://pypi.org/project/netwk)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/flowa-ai/netwk/blob/master/LICENSE)
[![Python Versions](https://img.shields.io/badge/python-3.7%20|%203.8%20|%203.9%20|%203.10%20|%203.11%20|%203.12%20-blue)](https://www.python.org/downloads/)

```
netwk: (V2.12.2)

Create fast, optimized, and easy-to-use neural networks.
```

## Installing
```shell
# Linux/macOS
python3 pip install -U netwk

# Windows
py -3 -m pip install -U netwk
```

# Usage
```python
import netwk as nk

nk.Seed(52) # Optional, used for testing purposes.

x = nk.Array([[0, 0], [0, 1], [1, 0], [1, 1]])
y = nk.Array([[0], [1], [1], [0]])
```
```python
network = nk.Network(
    nk.Input(2),
    (
        nk.Hidden(3, nk.Tanh), 
        nk.Hidden(2, nk.Sigmoid)
    ),
    nk.Output(1)
)
```
```python
nn.train(x, y, epoch=500)
print(nn.predict(x)
```
```javascript
/* Output (800ms Average):
>>> Epoch: 0, Error: 0.4984800733120248
>>> Epoch: 50, Error: 0.49632395442760113
>>> Epoch: 100, Error: 0.4781823668945816
>>> Epoch: 150, Error: 0.35665153383154413
>>> Epoch: 200, Error: 0.1874969659672475
>>> Epoch: 250, Error: 0.12789399797698137
>>> Epoch: 300, Error: 0.10069853802998781
>>> Epoch: 350, Error: 0.08495289503359527
>>> Epoch: 400, Error: 0.07452557528756484
>>> Epoch: 450, Error: 0.06702276126613768
[[0.10447174]
 [0.94106133]
 [0.94096653]
 [0.02281434]]
*/
```

# All activations:
```javascript
/*
    "Sigmoid",
    "Tanh",
    "ReLU",
    "LeakyReLU",
    "ELU",
    "Swish",
    "Gaussion",
    "Identity",
    "BinaryStep",
    "PReLU",
    "Exponential",
    "Softplus",
    "Softsign",
    "BentIdentity",
    "ArcTan",
    "SiLU",
    "Mish",
    "HardSigmoid",
    "HardTanh",
    "SoftExponential",
    "ISRU",
    "Sine",
    "Cosine",
    "SQNL",
    "SoftClipping",
    "BentIdentity2",
    "LogLog",
    "GELU",
    "Softmin",
*/
```

# Make your own!
```python
import netwk as nk

class MyModule(nk.Module):
    def __init__(self, *args, **kwargs):
        super().__init__("MyModule", *args, **kwargs)

    def forward(self, x):
        return x

    def backward(self, x, y, outputs):
        return nk.np.ones_like(x)
```

# Seeing used modules + seed.
```python
import netwk as nk

...Defining A Neural Network Here...

print(nk.modules())
```
```javascript
/* Example:
{'Input': Input(size: 2), 'Hidden': Hidden(size: 2), 'Output': Output(size: 1), 'Network': Network(
    Input Layer:
        1 Input(size: 2)

    Hidden Layers:        
        1 Hidden(size: 3)
        2 Hidden(size: 2)

    Output Layer:
        1 Output(size: 1)
)}
*/
```
```python
print(nk.seed())
# print(nk.seed(34))
```
```javascript
/* Example:
0
# 34
*/
```
