hox


Namehox JSON
Version 1.2.0 PyPI version JSON
download
home_pagehttps://github.com/usedToBeTomas/hox
SummaryLightweight neual network library project.
upload_time2024-12-13 23:13:44
maintainerNone
docs_urlNone
authorusedToBeTomas
requires_python>=3.6
licenseMIT
keywords neural network ml ai machine learning vanilla nn
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
<h1>HOX</h1>
HOX is not an alternative to big ml library like pytorch or tensorflow, it lacks features and optimization, such as gpu support. The goal is to create a lightweight library (< 100 lines of code) that is easy to use and quick to implement for creating small projects or experiment with ml.<br><br>
</div>

```cmd
pip install hox
```

---

## examples/mnist
### train.py
```python
from hox import *
import utils

#Create model (2 layers, 784 input neurons, 144 first layer, 10 output layer)
model = Model.create([Layer(784, 144, Relu()), Layer(144, 10, Sigmoid())])

#Upload mnist dataset
X, Y, x, y = utils.mnist()

#Shuffle the dataset to improve training stability
indices = np.random.permutation(len(X))
X, Y = X[indices], Y[indices]

#Train the model
model.train(X, Y, epochs = 1, rate = 2, batch_size = 16)

#Save the trained model
model.save("mnist")
```
### accuracy.py
```python
from hox import *
import utils

#Load model
model = Model.load("mnist")

#Upload mnist dataset
X, Y, x, y = utils.mnist()

#Accuracy tested on test10k data (x, y)
counter = 0
for i in range(len(x)):
    if np.argmax(model.forward(x[i])) == y[i]:
        counter +=1
print(str((counter*100)/len(y)) + "% accuracy")
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/usedToBeTomas/hox",
    "name": "hox",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "neural network, ml, ai, machine learning, vanilla, nn",
    "author": "usedToBeTomas",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/70/76/305a715ea634d748d9267164a492b37e286234d566ae7fe66c139a11b65f/hox-1.2.0.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\r\n<h1>HOX</h1>\r\nHOX is not an alternative to big ml library like pytorch or tensorflow, it lacks features and optimization, such as gpu support. The goal is to create a lightweight library (< 100 lines of code) that is easy to use and quick to implement for creating small projects or experiment with ml.<br><br>\r\n</div>\r\n\r\n```cmd\r\npip install hox\r\n```\r\n\r\n---\r\n\r\n## examples/mnist\r\n### train.py\r\n```python\r\nfrom hox import *\r\nimport utils\r\n\r\n#Create model (2 layers, 784 input neurons, 144 first layer, 10 output layer)\r\nmodel = Model.create([Layer(784, 144, Relu()), Layer(144, 10, Sigmoid())])\r\n\r\n#Upload mnist dataset\r\nX, Y, x, y = utils.mnist()\r\n\r\n#Shuffle the dataset to improve training stability\r\nindices = np.random.permutation(len(X))\r\nX, Y = X[indices], Y[indices]\r\n\r\n#Train the model\r\nmodel.train(X, Y, epochs = 1, rate = 2, batch_size = 16)\r\n\r\n#Save the trained model\r\nmodel.save(\"mnist\")\r\n```\r\n### accuracy.py\r\n```python\r\nfrom hox import *\r\nimport utils\r\n\r\n#Load model\r\nmodel = Model.load(\"mnist\")\r\n\r\n#Upload mnist dataset\r\nX, Y, x, y = utils.mnist()\r\n\r\n#Accuracy tested on test10k data (x, y)\r\ncounter = 0\r\nfor i in range(len(x)):\r\n    if np.argmax(model.forward(x[i])) == y[i]:\r\n        counter +=1\r\nprint(str((counter*100)/len(y)) + \"% accuracy\")\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Lightweight neual network library project.",
    "version": "1.2.0",
    "project_urls": {
        "Homepage": "https://github.com/usedToBeTomas/hox"
    },
    "split_keywords": [
        "neural network",
        " ml",
        " ai",
        " machine learning",
        " vanilla",
        " nn"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b64fd57a081c96b6994b40528af0384027b6ae2add72e03bf64b6ed26618a3ae",
                "md5": "9a30ce3429523b7dcb9eef111b37ce77",
                "sha256": "0ef78ca45cd9e92864dbe2cc8a143d1fd43db6f49c4b4921f94aade99710d22c"
            },
            "downloads": -1,
            "filename": "hox-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9a30ce3429523b7dcb9eef111b37ce77",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4467,
            "upload_time": "2024-12-13T23:13:42",
            "upload_time_iso_8601": "2024-12-13T23:13:42.387509Z",
            "url": "https://files.pythonhosted.org/packages/b6/4f/d57a081c96b6994b40528af0384027b6ae2add72e03bf64b6ed26618a3ae/hox-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7076305a715ea634d748d9267164a492b37e286234d566ae7fe66c139a11b65f",
                "md5": "20495fd7c36f785766e87d5d29898810",
                "sha256": "a03b228ac464f2154f7ef35249bd090ecd6494ce78acf443fa4d012c371e92c0"
            },
            "downloads": -1,
            "filename": "hox-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "20495fd7c36f785766e87d5d29898810",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 3229,
            "upload_time": "2024-12-13T23:13:44",
            "upload_time_iso_8601": "2024-12-13T23:13:44.742295Z",
            "url": "https://files.pythonhosted.org/packages/70/76/305a715ea634d748d9267164a492b37e286234d566ae7fe66c139a11b65f/hox-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-13 23:13:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "usedToBeTomas",
    "github_project": "hox",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "hox"
}
        
Elapsed time: 4.63503s