{"id":26623762,"url":"https://github.com/thealphajas/rawml-python","last_synced_at":"2026-02-25T07:08:32.605Z","repository":{"id":257812723,"uuid":"862719607","full_name":"TheAlphaJas/rawML-Python","owner":"TheAlphaJas","description":"Neural Networks without any high level API.","archived":false,"fork":false,"pushed_at":"2025-01-13T15:50:40.000Z","size":65,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T10:14:31.436Z","etag":null,"topics":["from-scratch","machine-learning","machine-learning-algorithms","neural-networks","numpy","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheAlphaJas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-25T04:41:28.000Z","updated_at":"2024-10-12T16:56:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c1adb80-9124-4bd5-8b37-e20e79b7b72a","html_url":"https://github.com/TheAlphaJas/rawML-Python","commit_stats":null,"previous_names":["thealphajas/rawml-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheAlphaJas/rawML-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphaJas%2FrawML-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphaJas%2FrawML-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphaJas%2FrawML-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphaJas%2FrawML-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheAlphaJas","download_url":"https://codeload.github.com/TheAlphaJas/rawML-Python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheAlphaJas%2FrawML-Python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278219765,"owners_count":25950350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["from-scratch","machine-learning","machine-learning-algorithms","neural-networks","numpy","python"],"created_at":"2025-03-24T10:17:52.618Z","updated_at":"2025-10-03T19:52:27.526Z","avatar_url":"https://github.com/TheAlphaJas.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rawML\nrawML is a hobby project where neural networks are implemented from scratch using pure Python and Numpy, with a class-based structure to define layers, optimizers, and loss functions. The goal is to implement how neural networks work at a low level, and create a (somewhat) modular custom code framework to implement ML algorithms, without relying on popular high-level deep learning frameworks like TensorFlow or PyTorch. In a nutshell, my lite version of PyTorch/TF, powered by NumPy(and possibly CuPy for a GPU accelerated framework).\n\n\n### Overview of current implementations:\n\n- **Linear Layers**: Fully connected layers with He-initialization of weights.\n- **Activation Functions**: ReLU activation implemented using numpy.\n- **Custom Tensor Class**: `jTensor`, an extension of Numpy's ndarray, supports storing gradients in the `.gd` attribute.\n- **Optimization**: Gradient Descent Optimizer (`GDOptimizer`) is implemented with learning rate control.\n- **Loss Function**: Mean Squared Error (MSE) Loss is implemented to compute the loss during training.\n- **Model Class**: The `CreateModel` class stiches all layers together, providing methods for forward passes and training with backpropagation. I plan on making it more customizable.\n- **Other basic functionality**: General essential functions, like mean, min, max, std, rand, randn etc are implemented in the rawML library. All are powered by NumPy.\n\n### Requirements\njust numpy :)\n```\npip install numpy\n```\n\n### Usage Instructions\nIts available on PyPI!\n```\npip install rawML\n```\n\n\n### Code Example\nThe getting_started.ipynb will show a brief overview on rawML, and how to use it as an high level API.\nThe following code is an example of the same.\n```\nimport rawML as rML\nfrom rawML.layers import relu, linear\nfrom rawML.optimizers import GDOptimizer\nfrom rawML.losses import MSELoss\nfrom sklearn.model_selection import train_test_split as tts\n\nLayerList = [\n    linear(100,20),\n    relu(),\n    linear(20,40)\n]\n\nopt = GDOptimizer(lr = 1e-2)\nloss = MSELoss()\nmodel = rML.createModel(LayerList, opt, loss)\n\nX = rML.rand((16, 100))\nY = rML.rand((16, 40))\n\n##sklearn train-test-split works with jTensors\nx_train, x_val, y_train, y_val = tts(X,Y,train_size=0.8)\n\n#Training\nmodel.train((x_train,y_train),(x_val,y_val),epochs=20,verbose_freq=5)\n\n#Predicting\ny = model(rML.randn([40,100]))\nprint(y.shape)\n```\n- As jTensors inherit(and behave very similar to) from numpy arrays, they support operations like .shape, and they can also be fed into scikit-learn's train test split\n\n### Future Implementations\nThis project is at a very initial stage, and I aim to expand it further. I will add implementations of more Optimizers, Loss functions along with other layers like MaxPool2D, CNNs. \nThere is no implementation of the concept of \"batch size\" which will be added very soon.\nAn easier way to add more custom metrics will also be implemented into the model.train() method.\nVerbose control will be added\nCurrently, the CreateModel class is restrictive to a sequential NN, which I plan on changing by implementing a more \"functional\" NN, to make more complex architectures like skip connections etc. The further aim to implement the famed UNet architecture using RawML.\nI also plan to explore GPU acceleration possibilities by migrating to CuPy instead of NumPy\nand etc...\n\n(PS, there exists an rML.about())\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthealphajas%2Frawml-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthealphajas%2Frawml-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthealphajas%2Frawml-python/lists"}