# SkyNet: A Numpy-powered, 100% Hand Made, Machine Learning Library 🚀
Welcome to SkyNet! This is my personal machine learning library. It is entirely made from scratch, using only NumPy. No professional machine learning libraries like Scikit-Learn, TensorFlow, or PyTorch are allowed. Everything is made by applying the fundamental concepts of machine learning. It supports both classical algorithms, supervised and unsupervised, as well as deep learning. This project is in its first stages, so there is a lot more to come. This serves as a showcase of my skills and conceptual knowledge in machine learning, calculus, linear algebra, and statistics. Stay tuned, because there is a lot more to be implemented here!

> **Disclaimer**: SkyNet is, at its heart, a project of passion and learning. Please refrain from deploying it in a professional setting. While meticulously crafted, it doesn't leverage state-of-the-art optimization and lacks GPU support.
## Table of Contents
1. [Features](#features)
2. [Installation](#installation)
3. [Usage](#usage)
4. [Acknowledgements](#acknowledgements)
## Features
- **NumPy Powered:** SkyNet is built entirely with NumPy, showcasing a true understanding of the algorithms.
- **Classical Machine Learning:** SkyNet supports both supervised and unsupervised machine learning models.
- **Custom Neural Nets:** SkyNet allows you to create custom neural networks with customizable layers, multiple activation functions, and optimization methods.
- **Transparency:** SkyNet's code is well-documented with detailed comments and docstrings to guide you through each part of the code.
## Installation
Install `skynet_ml` directly from PyPI:
```bash
pip install skynet-ml
```
## Usage
Getting started with SkyNet is pretty straightforward. Here's a step-by-step guide:
1. **Setup Your Environment:**
Before diving in, ensure you have numpy:
```bash
pip install numpy
```
2. **Enter skynet:**
Navigate to the SkyNet directory:
```bash
cd skynet
```
3. **Make Magic!:**
```bash
# import all the stuff you need
import numpy as np
from keras.datasets import mnist
from keras.utils import to_categorical
from skynet_ml.nn.models import Sequential
from skynet_ml.nn.layers import Dense
from skynet_ml.nn.optimizers import Adam
from skynet_ml.metrics import ConfusionMatrix
from skynet_ml.utils.nn.early_stopping import EarlyStopping
# read the mnist dataset
(x_train, y_train),(x_test, y_test) = mnist.load_data()
num_labels = len(np.unique(y_train))
y_train = to_categorical(y_train)
y_test = to_categorical(y_test)
image_size = x_train.shape[1]
input_size = image_size**2
x_train = np.reshape(x_train, [-1, input_size])
x_train = x_train.astype('float32') / 255
x_test = np.reshape(x_test, [-1, input_size])
x_test = x_test.astype('float32') / 255
# create the model
model = Sequential()
# add layers to the mdoel
model.add(Dense(n_units=150, activation="leaky_relu", input_dim=input_size))
model.add(Dense(n_units=150, activation="leaky_relu"))
model.add(Dense(n_units=num_labels, activation="softmax"))
# compile the model
opt = Adam(learning_rate=0.001, beta1=0.9, beta2=0.999)
model.compile(loss="categorical_crossentropy", optimizer=opt, regularizer="l2")
# fit your model
model.fit(x_train=x_train,
y_train=y_train,
x_val=x_test,
y_val=y_test,
metrics=["accuracy", "precision", "recall", "fscore"],
early_stopping=EarlyStopping(patience=10, min_delta=0.0001),
epochs=5,
batch_size=32,
save_training_history_in="testing/logs/mnist_sequential.csv")
# predict with the model
y_pred = model.predict(x_test)
# compute the confusion matrix
cf = ConfusionMatrix(task_type="multiclass").compute(y_test, y_pred)
ConfusionMatrix(task_type="multiclass").plot(cf, save_in="testing/logs/confusion_matrix.png")
# save the model
save_model(model, "testing/logs/mnist_sequential.pkl")
plot_model(model, save_in="testing/logs/mnist_sequential_model.txt")
# plot the training history
plot_training_history("testing/logs/mnist_sequential.csv", save_in="testing/logs/mnist_sequential.png")
```
## Acknowledgements
- Big thanks to Numpy for being the foundation of this project.
- Grateful for my professor Lucas Kupssinsku who is teaching me all this stuff.
- Big thanks to Ian Goodfellow for writing a bible about deep learning.
- Big thanks to my boy chatGPT, who wrote 90% of the docstrings because I'm way to lazzy (including this docstring hehe).

> **Disclaimer**: SkyNet is a personal project and it's not designed for professional use. Therefore, do not sue me for using the same name as the evil A.I in The Terminator, the name is a joke.
Raw data
{
"_id": null,
"home_page": "https://github.com/macedoti13/skynet_ml",
"name": "skynet-ml",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Thiago Macedo",
"author_email": "thialmacedo@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/97/b4/762a38064680d6758165c1c07d2804e86d2b1769ce64c9b683238141a5e6/skynet_ml-1.2.0.7.tar.gz",
"platform": null,
"description": "# SkyNet: A Numpy-powered, 100% Hand Made, Machine Learning Library \ud83d\ude80\n\nWelcome to SkyNet! This is my personal machine learning library. It is entirely made from scratch, using only NumPy. No professional machine learning libraries like Scikit-Learn, TensorFlow, or PyTorch are allowed. Everything is made by applying the fundamental concepts of machine learning. It supports both classical algorithms, supervised and unsupervised, as well as deep learning. This project is in its first stages, so there is a lot more to come. This serves as a showcase of my skills and conceptual knowledge in machine learning, calculus, linear algebra, and statistics. Stay tuned, because there is a lot more to be implemented here!\n\n\n\n> **Disclaimer**: SkyNet is, at its heart, a project of passion and learning. Please refrain from deploying it in a professional setting. While meticulously crafted, it doesn't leverage state-of-the-art optimization and lacks GPU support.\n\n## Table of Contents\n1. [Features](#features)\n2. [Installation](#installation)\n3. [Usage](#usage)\n4. [Acknowledgements](#acknowledgements)\n\n## Features\n- **NumPy Powered:** SkyNet is built entirely with NumPy, showcasing a true understanding of the algorithms.\n- **Classical Machine Learning:** SkyNet supports both supervised and unsupervised machine learning models.\n- **Custom Neural Nets:** SkyNet allows you to create custom neural networks with customizable layers, multiple activation functions, and optimization methods.\n- **Transparency:** SkyNet's code is well-documented with detailed comments and docstrings to guide you through each part of the code.\n\n## Installation\n\nInstall `skynet_ml` directly from PyPI:\n\n```bash\npip install skynet-ml\n```\n\n## Usage\nGetting started with SkyNet is pretty straightforward. Here's a step-by-step guide:\n\n1. **Setup Your Environment:**\n\nBefore diving in, ensure you have numpy:\n```bash\npip install numpy\n```\n\n2. **Enter skynet:** \n\nNavigate to the SkyNet directory:\n```bash\ncd skynet\n```\n\n3. **Make Magic!:** \n```bash\n# import all the stuff you need \nimport numpy as np\nfrom keras.datasets import mnist\nfrom keras.utils import to_categorical\nfrom skynet_ml.nn.models import Sequential\nfrom skynet_ml.nn.layers import Dense\nfrom skynet_ml.nn.optimizers import Adam\nfrom skynet_ml.metrics import ConfusionMatrix\nfrom skynet_ml.utils.nn.early_stopping import EarlyStopping\n\n# read the mnist dataset\n(x_train, y_train),(x_test, y_test) = mnist.load_data()\n\nnum_labels = len(np.unique(y_train))\ny_train = to_categorical(y_train)\ny_test = to_categorical(y_test)\nimage_size = x_train.shape[1]\ninput_size = image_size**2\n\nx_train = np.reshape(x_train, [-1, input_size])\nx_train = x_train.astype('float32') / 255\nx_test = np.reshape(x_test, [-1, input_size])\nx_test = x_test.astype('float32') / 255\n\n# create the model\nmodel = Sequential()\n\n# add layers to the mdoel\nmodel.add(Dense(n_units=150, activation=\"leaky_relu\", input_dim=input_size))\nmodel.add(Dense(n_units=150, activation=\"leaky_relu\"))\nmodel.add(Dense(n_units=num_labels, activation=\"softmax\"))\n\n# compile the model\nopt = Adam(learning_rate=0.001, beta1=0.9, beta2=0.999)\nmodel.compile(loss=\"categorical_crossentropy\", optimizer=opt, regularizer=\"l2\")\n\n# fit your model\nmodel.fit(x_train=x_train, \n y_train=y_train, \n x_val=x_test, \n y_val=y_test, \n metrics=[\"accuracy\", \"precision\", \"recall\", \"fscore\"], \n early_stopping=EarlyStopping(patience=10, min_delta=0.0001),\n epochs=5, \n batch_size=32,\n save_training_history_in=\"testing/logs/mnist_sequential.csv\")\n\n# predict with the model\ny_pred = model.predict(x_test)\n\n# compute the confusion matrix\ncf = ConfusionMatrix(task_type=\"multiclass\").compute(y_test, y_pred)\nConfusionMatrix(task_type=\"multiclass\").plot(cf, save_in=\"testing/logs/confusion_matrix.png\")\n\n# save the model \nsave_model(model, \"testing/logs/mnist_sequential.pkl\")\nplot_model(model, save_in=\"testing/logs/mnist_sequential_model.txt\")\n\n# plot the training history\nplot_training_history(\"testing/logs/mnist_sequential.csv\", save_in=\"testing/logs/mnist_sequential.png\")\n```\n\n## Acknowledgements\n\n- Big thanks to Numpy for being the foundation of this project.\n- Grateful for my professor Lucas Kupssinsku who is teaching me all this stuff. \n- Big thanks to Ian Goodfellow for writing a bible about deep learning. \n- Big thanks to my boy chatGPT, who wrote 90% of the docstrings because I'm way to lazzy (including this docstring hehe).\n\n\n\n> **Disclaimer**: SkyNet is a personal project and it's not designed for professional use. Therefore, do not sue me for using the same name as the evil A.I in The Terminator, the name is a joke. \n",
"bugtrack_url": null,
"license": "",
"summary": "A hand made machine learning library from scratch, by Thiago Macedo",
"version": "1.2.0.7",
"project_urls": {
"Homepage": "https://github.com/macedoti13/skynet_ml"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "231c26e4bdf3ca7953c98fcb919e43548e751f7f7c838c2f6be68368427be69d",
"md5": "52dfe7cd41fb6e893d5ca13209c87c1a",
"sha256": "891afed4e08d5ed9e1d14707eeafd724171a3fa6a77ff17fd0df77af385671f4"
},
"downloads": -1,
"filename": "skynet_ml-1.2.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "52dfe7cd41fb6e893d5ca13209c87c1a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 75606,
"upload_time": "2023-10-17T15:55:54",
"upload_time_iso_8601": "2023-10-17T15:55:54.549458Z",
"url": "https://files.pythonhosted.org/packages/23/1c/26e4bdf3ca7953c98fcb919e43548e751f7f7c838c2f6be68368427be69d/skynet_ml-1.2.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "97b4762a38064680d6758165c1c07d2804e86d2b1769ce64c9b683238141a5e6",
"md5": "a2d9267625269ddd4da41f0f0c603dbc",
"sha256": "c65507bd3889cce2612103ca95e70faae27b0d42ab600c168941f4a3e37d1e64"
},
"downloads": -1,
"filename": "skynet_ml-1.2.0.7.tar.gz",
"has_sig": false,
"md5_digest": "a2d9267625269ddd4da41f0f0c603dbc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 49758,
"upload_time": "2023-10-17T15:55:55",
"upload_time_iso_8601": "2023-10-17T15:55:55.938306Z",
"url": "https://files.pythonhosted.org/packages/97/b4/762a38064680d6758165c1c07d2804e86d2b1769ce64c9b683238141a5e6/skynet_ml-1.2.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-17 15:55:55",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "macedoti13",
"github_project": "skynet_ml",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "kaleido",
"specs": []
},
{
"name": "numpy",
"specs": []
},
{
"name": "joblib",
"specs": []
},
{
"name": "pandas",
"specs": []
},
{
"name": "plotly",
"specs": []
},
{
"name": "matplotlib",
"specs": []
},
{
"name": "seabron",
"specs": []
}
],
"lcname": "skynet-ml"
}