From e6104e43c955a77fb61e30e10e4edc3bbc333346 Mon Sep 17 00:00:00 2001 From: lucasdelimanogueira Date: Fri, 10 May 2024 20:12:15 -0300 Subject: [PATCH] small changes --- README.md | 18 +- examples/getting_started.ipynb | 311 +++++++++++++++++++ examples/train.ipynb | 37 ++- install.sh | 4 +- norch/__pycache__/tensor.cpython-38.pyc | Bin 13805 -> 13809 bytes norch/csrc/cpu.cpp | 1 - norch/norch.egg-info/PKG-INFO | 30 ++ norch/norch.egg-info/SOURCES.txt | 24 ++ norch/norch.egg-info/dependency_links.txt | 1 + norch/norch.egg-info/top_level.txt | 3 + norch/tensor.py | 1 - norch/utils/__pycache__/utils.cpython-38.pyc | Bin 1459 -> 759 bytes norch/utils/utils.py | 28 +- norch/utils/utils_unittests.py | 24 ++ setup.py | 27 ++ test.py | 240 -------------- test.sh | 4 - tests/test_nn.py | 2 +- 18 files changed, 468 insertions(+), 287 deletions(-) create mode 100644 examples/getting_started.ipynb create mode 100644 norch/norch.egg-info/PKG-INFO create mode 100644 norch/norch.egg-info/SOURCES.txt create mode 100644 norch/norch.egg-info/dependency_links.txt create mode 100644 norch/norch.egg-info/top_level.txt create mode 100644 norch/utils/utils_unittests.py create mode 100644 setup.py delete mode 100644 test.py delete mode 100755 test.sh diff --git a/README.md b/README.md index 49f6b3f..448a9c8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,16 @@ -# foo -Recreating PyTorch from scratch +# PyNorch +Recreating PyTorch from scratch (C/C++, CUDA and Python, with GPU support and automatic differentiation!) + +# 1 - About +**PyNorch** is a deep learning framework constructed using C/C++, CUDA and Python. This is a personal project with educational purpose only! `Norch` means **NOT** PyTorch, and we have **NO** claims to rivaling the already established PyTorch. The main objective of **PyNorch** was to give a brief understanding of how a deep learning framework works internally. It implements the Tensor object, GPU support and an automatic differentiation system. + +# 2 - Installation +```css +$ sudo apt install nvidia-cuda-toolkit +$ git clone https://github.com/lucasdelimanogueira/PyNorch.git +$ cd build +$ make +$ cd .. +``` + +# 3 - Get started \ No newline at end of file diff --git a/examples/getting_started.ipynb b/examples/getting_started.ipynb new file mode 100644 index 0000000..974f76d --- /dev/null +++ b/examples/getting_started.ipynb @@ -0,0 +1,311 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Tensor operations" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "/home/lln/Documentos/recreate_pytorch/PyNorch\n" + ] + } + ], + "source": [ + "%cd .." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 1 - Basic operations" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "t1 =\n", + "tensor([[1.0, 2.0,],\n", + "[3.0, 4.0,]], device=\"cpu\", requires_grad=False)\n", + "t2 =\n", + "tensor([[4.0, 3.0,],\n", + "[2.0, 1.0,]], device=\"cpu\", requires_grad=False)\n", + "\n", + "Some basic operations\n", + "x1 + x2: \n", + "tensor([[5.0, 5.0,],\n", + "[5.0, 5.0,]], device=\"cpu\", requires_grad=False)\n", + "x1 - x2: \n", + "tensor([[-3.0, -1.0,],\n", + "[1.0, 3.0,]], device=\"cpu\", requires_grad=False)\n", + "x1 * x2: \n", + "tensor([[4.0, 6.0,],\n", + "[6.0, 4.0,]], device=\"cpu\", requires_grad=False)\n", + "x1 / x2: \n", + "tensor([[0.25, 0.6666666865348816,],\n", + "[1.5, 4.0,]], device=\"cpu\", requires_grad=False)\n", + "x1 / 10: \n", + "tensor([[0.10000000149011612, 0.20000000298023224,],\n", + "[0.30000001192092896, 0.4000000059604645,]], device=\"cpu\", requires_grad=False)\n", + "x1 @ x2: \n", + "tensor([[8.0, 5.0,],\n", + "[20.0, 13.0,]], device=\"cpu\", requires_grad=False)\n", + "x1 ** 2: \n", + "tensor([[1.0, 4.0,],\n", + "[9.0, 16.0,]], device=\"cpu\", requires_grad=False)\n" + ] + } + ], + "source": [ + "import norch\n", + "\n", + "x1 = norch.Tensor([[1, 2], \n", + " [3, 4]])\n", + "x2 = norch.Tensor([[4, 3], \n", + " [2, 1]])\n", + "\n", + "print(f\"t1 =\\n{x1}\")\n", + "print(f\"t2 =\\n{x2}\")\n", + "\n", + "print(\"\\nSome basic operations\")\n", + "print(f\"x1 + x2: \\n{x1 + x2}\")\n", + "print(f\"x1 - x2: \\n{x1 - x2}\")\n", + "print(f\"x1 * x2: \\n{x1 * x2}\")\n", + "print(f\"x1 / x2: \\n{x1 / x2}\")\n", + "print(f\"x1 / 10: \\n{x1 / 10}\")\n", + "print(f\"x1 @ x2: \\n{x1 @ x2}\")\n", + "print(f\"x1 ** 2: \\n{x1 ** 2}\")" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "x1 reshape: \n", + "tensor([[1.0, 2.0, 3.0, 4.0,]], device=\"cpu\", requires_grad=False)\n", + "x1 transpose axes: \n", + "tensor([[1.0, 3.0,],\n", + "[2.0, 4.0,]], device=\"cpu\", requires_grad=False)\n", + "x1 transpose: \n", + "tensor([[1.0, 3.0,],\n", + "[2.0, 4.0,]], device=\"cpu\", requires_grad=False)\n", + "x1 zeros_like: \n", + "tensor([[0.0, 0.0,],\n", + "[0.0, 0.0,]], device=\"cpu\", requires_grad=None)\n", + "x1 ones_like: \n", + "tensor([[1.0, 1.0,],\n", + "[1.0, 1.0,]], device=\"cpu\", requires_grad=None)\n", + "sin(x1): \n", + "tensor([[0.8414709568023682, 0.9092974066734314,],\n", + "[0.14112000167369843, -0.756802499294281,]], device=\"cpu\", requires_grad=False)\n", + "cos(x1): \n", + "tensor([[0.5403022766113281, -0.416146844625473,],\n", + "[-0.9899924993515015, -0.6536436080932617,]], device=\"cpu\", requires_grad=False)\n" + ] + } + ], + "source": [ + "print(f\"x1 reshape: \\n{x1.reshape([1, 4])}\")\n", + "print(f\"x1 transpose axes: \\n{x1.transpose(1, 0)}\")\n", + "print(f\"x1 transpose: \\n{x1.T}\")\n", + "\n", + "print(f\"x1 zeros_like: \\n{x1.zeros_like()}\")\n", + "print(f\"x1 ones_like: \\n{x1.ones_like()}\")\n", + "\n", + "print(f\"sin(x1): \\n{x1.sin()}\")\n", + "print(f\"cos(x1): \\n{x1.cos()}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## 2 - Autograd" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a.shape: [5, 3, 2]\n", + "b.shape: [5, 4, 3]\n", + "\n", + "\n", + "gradient a: tensor([[\n", + "[18.437000274658203, 18.437000274658203,],\n", + " [22.269001007080078, 22.269001007080078,],\n", + " [5.723199844360352, 5.723199844360352,]],\n", + "[\n", + "[18.437000274658203, 18.437000274658203,],\n", + " [22.269001007080078, 22.269001007080078,],\n", + " [5.723199844360352, 5.723199844360352,]],\n", + "[\n", + "[18.437000274658203, 18.437000274658203,],\n", + " [22.269001007080078, 22.269001007080078,],\n", + " [5.723199844360352, 5.723199844360352,]],\n", + "[\n", + "[18.437000274658203, 18.437000274658203,],\n", + " [22.269001007080078, 22.269001007080078,],\n", + " [5.723199844360352, 5.723199844360352,]],\n", + "[\n", + "[18.437000274658203, 18.437000274658203,],\n", + " [22.269001007080078, 22.269001007080078,],\n", + " [5.723199844360352, 5.723199844360352,]]], device=\"cpu\", requires_grad=None)\n" + ] + } + ], + "source": [ + "a = norch.Tensor([\n", + " [[1.234, 2.123], [3.635, 4.456], [5.678, 6.789]],\n", + " [[7.890, 8.901], [9.012, 1.234], [2.345, 3.456]],\n", + " [[4.567, 5.678], [6.789, 7.890], [8.901, 9.012]],\n", + " [[1.234, 2.345], [3.456, 4.567], [5.678, 6.789]],\n", + " [[7.890, 8.901], [9.012, 1.234], [2.345, 3.456]]\n", + " ], requires_grad=True)\n", + "\n", + "\n", + "b = norch.Tensor([[\n", + " [1.234, 2.123, 1.5],\n", + " [5.678, 6.789, 1.293],\n", + " [3.635, 4.456, 1.0202],\n", + " [7.890, 8.901, 1.91],\n", + " ],[\n", + " [1.234, 2.123, 1.5],\n", + " [5.678, 6.789, 1.293],\n", + " [3.635, 4.456, 1.0202],\n", + " [7.890, 8.901, 1.91],\n", + " ],[\n", + " [1.234, 2.123, 1.5],\n", + " [5.678, 6.789, 1.293],\n", + " [3.635, 4.456, 1.0202],\n", + " [7.890, 8.901, 1.91],\n", + " ],[\n", + " [1.234, 2.123, 1.5],\n", + " [5.678, 6.789, 1.293],\n", + " [3.635, 4.456, 1.0202],\n", + " [7.890, 8.901, 1.91],\n", + " ],[\n", + " [1.234, 2.123, 1.5],\n", + " [5.678, 6.789, 1.293],\n", + " [3.635, 4.456, 1.0202],\n", + " [7.890, 8.901, 1.91],\n", + " ]])\n", + "\n", + "print(f\"a.shape: {a.shape}\")\n", + "print(f\"b.shape: {b.shape}\\n\\n\")\n", + "\n", + "result = b @ a\n", + "result = result.sum()\n", + "result.backward()\n", + "\n", + "print(f\"gradient a: {a.grad}\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Modules" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "import norch.nn as nn\n", + "\n", + "class MyModule(nn.Module):\n", + " def __init__(self):\n", + " super(MyModule, self).__init__()\n", + "\n", + " self.layer1 = nn.Linear(100, 1000)\n", + " self.sigmoid1 = nn.Sigmoid()\n", + " self.layer2 = nn.Linear(1000, 2)\n", + " self.sigmoid2 = nn.Sigmoid()\n", + "\n", + " def forward(self, x):\n", + " out = self.layer1(x)\n", + " out = self.sigmoid1(out)\n", + " out = self.layer2(out)\n", + " out = self.sigmoid2(out)\n", + "\n", + " return out" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "MyModule(\n", + " (layer1): Linear(input_dim=100, output_dim=1000, bias=True)\n", + " (sigmoid1): Sigmoid()\n", + " (layer2): Linear(input_dim=1000, output_dim=2, bias=True)\n", + " (sigmoid2): Sigmoid()\n", + ")" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model = MyModule()\n", + "model" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/examples/train.ipynb b/examples/train.ipynb index 84d7fdc..3a37c54 100644 --- a/examples/train.ipynb +++ b/examples/train.ipynb @@ -16,7 +16,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "/home/lln/Documentos/recreate_pytorch/foo\n" + "/home/lln/Documentos/recreate_pytorch/PyNorch\n" ] } ], @@ -26,7 +26,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -107,6 +107,30 @@ " loss_list.append(loss[0])" ] }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "MyModel(\n", + " (fc1): Linear(input_dim=1, output_dim=10, bias=True)\n", + " (sigmoid): Sigmoid()\n", + " (fc2): Linear(input_dim=10, output_dim=1, bias=True)\n", + ")" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "model" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -116,7 +140,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -144,13 +168,6 @@ "plt.xticks(epochs_list)\n", "plt.show()" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/install.sh b/install.sh index 56577b5..aa42aec 100755 --- a/install.sh +++ b/install.sh @@ -1,2 +1,4 @@ +apt install nvidia-cuda-toolkit cd build -make \ No newline at end of file +make +cd .. \ No newline at end of file diff --git a/norch/__pycache__/tensor.cpython-38.pyc b/norch/__pycache__/tensor.cpython-38.pyc index 74a53d0b87c6d5237c6be0f1f046e6827181235d..33612254b20f19a4d86806dc8cc702824f8c7edf 100644 GIT binary patch delta 3753 zcmbVPTWl0n7~a|KUb@@c(v~jU+6%ody+8{nBotDL6-q(06yty#w!71I?C#EbX11ju z7Gq3IG%o3EUztn}LWU*ku6XFk4KIU@yR51CPwSX3t~Hd@PH3AjJZ-jurB$Ci$2 zG%}aICS7(&_3VW6P@oxG+#E8Jp4(6B(qA~+Bq_jdyLzM`v%61K3uSfKzLmo;i@V3S z;#sJScH(ItpdSErrmg|3gv=(s+QWW!Uug>PRj7(q;Z-%D3{VefV^=*J`!-|Q4(I>~ za%B-MxkNqq4TtGt99A5(ll|f82xi?BrZVMPLeWV~omY;q!Sb)yH(2FuI9S9W-3BX# z_UIs2&~|`@r<E_DNNfs|7Y%*|$}}sU9qQ zIbSWI>4M$ZaVPu@T!M&5+3#zUfO4O_Y$jeUbDJW8?+QZ>(He5Z|FQP6{ z>|K#emKK8LNEU&bPucg?hlRw7T}aSYC>sG-gj`XDGn)I1jo19*1N)3aO&B!D_W466 za}o2*DhA<<<7U8Wpeb9#AzrGGbgPLdkExz-jG-m)5}Q+Qp> zVGkixN%HMKq(k+6Qj^HolhEUwiD_Yj?tr8y(lK5(wad96czH^Rp(J#TTI!}~Ly4mH zjYOjb1-)Vpl#Ej|<`haxmoyzaX(Cod|SD z!K{1q3`Ev(PESogv~!cG=>q49@=Gk{WV z3HdFoFWAcx0blxZqh#-}cqY;$(v~;e*sm3VaZ#*oT)phqBjH$>l6Wds!c~zo|D@P< zBo!-kZjALbKiwyegK4nc4iE{nWP*DP6J(Tq*nD9S70FvR#{aF&7a?vDLi&VMoITU> zRQF*hj{`;k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7Gfu>(km9Wa3K$ z^S}VLkW?+Td&7I!iTzK^A#?a=ju;zP`8r-NXG|S0<$Gr`sf5Y9tzlJ8^0t&PGgQs{ d4lSa`3LRR|l}u7S%=@dyK=eYqc0=C!@PA^I8T0@E diff --git a/norch/csrc/cpu.cpp b/norch/csrc/cpu.cpp index 6cb8071..ee46dca 100644 --- a/norch/csrc/cpu.cpp +++ b/norch/csrc/cpu.cpp @@ -18,7 +18,6 @@ void sub_tensor_cpu(Tensor* tensor1, Tensor* tensor2, float* result_data) { } } - void elementwise_mul_tensor_cpu(Tensor* tensor1, Tensor* tensor2, float* result_data) { for (int i = 0; i < tensor1->size; i++) { diff --git a/norch/norch.egg-info/PKG-INFO b/norch/norch.egg-info/PKG-INFO new file mode 100644 index 0000000..6adfe74 --- /dev/null +++ b/norch/norch.egg-info/PKG-INFO @@ -0,0 +1,30 @@ +Metadata-Version: 2.1 +Name: norch +Version: 0.0.1 +Summary: A deep learning framework +Home-page: https://github.com/lucasdelimanogueira/PyNorch +Author: Lucas de Lima +Author-email: nogueiralucasdelima@gmail.com +Project-URL: Bug Tracker, https://github.com/lucasdelimanogueira/PyNorch/issues +Project-URL: Repository, https://github.com/lucasdelimanogueira/PyNorch +Classifier: Programming Language :: Python :: 3 +Classifier: Operating System :: OS Independent +Requires-Python: >=3.6 +Description-Content-Type: text/markdown + +# PyNorch +Recreating PyTorch from scratch (C/C++, CUDA and Python, with GPU support and automatic differentiation!) + +# 1 - About +**PyNorch** is a deep learning framework constructed using C/C++, CUDA and Python. This is a personal project with educational purpose only! `Norch` means **NOT** PyTorch, and we have **NO** claims to rivaling the already established PyTorch. The main objective of **PyNorch** was to give a brief understanding of how a deep learning framework works internally. It implements the Tensor object, GPU support and an automatic differentiation system. + +# 2 - Installation +```css +$ sudo apt install nvidia-cuda-toolkit +$ git clone https://github.com/lucasdelimanogueira/PyNorch.git +$ cd build +$ make +$ cd .. +``` + +# 3 - Get started diff --git a/norch/norch.egg-info/SOURCES.txt b/norch/norch.egg-info/SOURCES.txt new file mode 100644 index 0000000..d918a1f --- /dev/null +++ b/norch/norch.egg-info/SOURCES.txt @@ -0,0 +1,24 @@ +README.md +install.sh +setup.py +norch/nn/__init__.py +norch/nn/activation.py +norch/nn/loss.py +norch/nn/module.py +norch/nn/parameter.py +norch/nn/modules/__init__.py +norch/nn/modules/linear.py +norch/norch.egg-info/PKG-INFO +norch/norch.egg-info/SOURCES.txt +norch/norch.egg-info/dependency_links.txt +norch/norch.egg-info/top_level.txt +norch/optim/__init__.py +norch/optim/optimizer.py +norch/optim/optimizers/__init__.py +norch/optim/optimizers/sgd.py +norch/utils/__init__.py +norch/utils/utils.py +norch/utils/utils_unittests.py +tests/test_autograd.py +tests/test_nn.py +tests/test_operations.py \ No newline at end of file diff --git a/norch/norch.egg-info/dependency_links.txt b/norch/norch.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/norch/norch.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/norch/norch.egg-info/top_level.txt b/norch/norch.egg-info/top_level.txt new file mode 100644 index 0000000..793c63f --- /dev/null +++ b/norch/norch.egg-info/top_level.txt @@ -0,0 +1,3 @@ +nn +optim +utils diff --git a/norch/tensor.py b/norch/tensor.py index 7f5f9c9..fc5d0de 100644 --- a/norch/tensor.py +++ b/norch/tensor.py @@ -57,7 +57,6 @@ class Tensor: self.grad = None self.grad_fn = None - def flatten(self, nested_list): def flatten_recursively(nested_list): flat_data = [] diff --git a/norch/utils/__pycache__/utils.cpython-38.pyc b/norch/utils/__pycache__/utils.cpython-38.pyc index 50597077d9a24ca4d15c688f3969d16b8ba99ecb..95d3b4582f73d44896121e8f25e8606d2085c37f 100644 GIT binary patch delta 287 zcmdnY{hie%l$V!_0SKa&+NDioWMFs<;vfSiAjbiSi$#D$3PTEG4nq_}3R4Pm3qurR z3S%&XCdKZ(1RDbr zgC^50=A6{LTdYNidFiQ|jJH^kwD5wofc5bJS~=OWqd6X%8?u50yEFMbW`!9nfG^Qelzp4zuMX90gZ3QA5VXF0bcTE zb2zm5l*Am6k{~gIsGTuFDWr1=k&v$RXm;e5>`MOMU%!zKA?RLw z(hF#Op>m}sr3xlNmYOp7AuVTtp5(Ha2YEF=RoVo!3(Rb?P{Cb0-L;mQ0bjGanTMd0 z4#_cz*&}sE$WMk#Ea5qFonDAv#koru#PvTkG#iAX>9kR!Zk4CgLeH;6BMv@nFunrq z)04l)qggRmqb$ou4~wLltGq1CNUKCEN+4c5E(@K^M$@7g<#tt-X=X-NA1od>y+h70 zDdvmufU$A0J0RfVgR@l;;ub>8?+y;LBAH}nOpCSIjeap~c5#b+?UJ&2_Bl`PO`D@d z9%8fme<8F-R#(_;r#UqtwzahedW$YJ({D)fA5f}@lc~J%2Lq zAC_+I)}nN3=LsId`TMn?t~xjAz^*yOMgm4h`V_4URlJJUax5Jx|h&h1-0)Y??UOqG+tRPG8KB!PEwh& zn8&5cO`+}6Xt3h!>agjqKsMg@ldMuLF6NhQY~!y%SjustfF10K{ubfHfzbPO^2eXE zmrsBD>-TZOm0u4gD$D02<{eV}F;Ww852(!!?L_U=;t}nrs(3^de3M=^&g9gP%CgXn zx-Im3>&5-1s}?5Bio9`UI-Ry~`BQD-?(nBJ(W))n9gfTp00*ewr8z|XHcy`BV;j#h f)TUuyY