diff --git a/PyTorch_Explore/1_Regression.ipynb b/PyTorch_Explore/1_Regression.ipynb
deleted file mode 100644
index db9a922..0000000
--- a/PyTorch_Explore/1_Regression.ipynb
+++ /dev/null
@@ -1,370 +0,0 @@
-{
- "nbformat": 4,
- "nbformat_minor": 0,
- "metadata": {
- "colab": {
- "provenance": [],
- "toc_visible": true,
- "authorship_tag": "ABX9TyMuXeJk+Zh3Dm2wwP6dBkFI",
- "include_colab_link": true
- },
- "kernelspec": {
- "name": "python3",
- "display_name": "Python 3"
- },
- "language_info": {
- "name": "python"
- }
- },
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {
- "id": "view-in-github",
- "colab_type": "text"
- },
- "source": [
- ""
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## Linear Regression"
- ],
- "metadata": {
- "id": "Q6KYqteBVejh"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "# 1) Design Model (input, output size, forward pass)\n",
- "# 2) Construct Loss and optimizer\n",
- "# 3) Training Loop\n",
- "# - forward pass: compute prediction\n",
- "# - backward pass: gradients\n",
- "# - Update weights\n",
- "# - Iterated copuple of times"
- ],
- "metadata": {
- "id": "k7BNBK8jUnz5"
- },
- "execution_count": 27,
- "outputs": []
- },
- {
- "cell_type": "code",
- "execution_count": 28,
- "metadata": {
- "id": "oX4MQ4bH8iAQ"
- },
- "outputs": [],
- "source": [
- "import torch\n",
- "import torch.nn as nn # Neural Network modules\n",
- "import numpy as np\n",
- "from sklearn import datasets\n",
- "import matplotlib.pyplot as plt"
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "# 0) Prepare Data\n",
- "X_numpy, y_numpy = datasets.make_regression(n_samples=100, # Number of datapoints\n",
- " n_features=1, # Number of features\n",
- " noise=20, # random noise added to the target values\n",
- " random_state=1)\n",
- "X = torch.from_numpy(X_numpy.astype(np.float32)) # Converts NumPy array to a PyTorch tensor\n",
- "y = torch.from_numpy(y_numpy.astype(np.float32)) # Converts NumPy array to a PyTorch tensor\n",
- "y = y.view(y.shape[0], 1) # Reshape the target tensor to have a shape of (100, 1)\n",
- "# the target tensor should have the same number of columns as the input tensor\n",
- "\n",
- "n_samples, n_features = X.shape # store the number of samples and features in the data"
- ],
- "metadata": {
- "id": "OWVhelS0UreC"
- },
- "execution_count": 29,
- "outputs": []
- },
- {
- "cell_type": "code",
- "source": [
- "# 1) model\n",
- "\n",
- "# store the number of input and output features for the model\n",
- "input_size = n_features\n",
- "output_size = 1\n",
- "\n",
- "model = nn.Linear(input_size, output_size) # Linead Regression Model"
- ],
- "metadata": {
- "id": "ODgAKQuPUc1b"
- },
- "execution_count": 30,
- "outputs": []
- },
- {
- "cell_type": "code",
- "source": [
- "# 2) loss and optimizer\n",
- "learning_rate = 0.01 # specify the learning rate of the optimizer\n",
- "criterion = nn.MSELoss() # loss function\n",
- "optimizer = torch.optim.SGD(model.parameters(), lr = learning_rate)"
- ],
- "metadata": {
- "id": "Y5pgS7hwUvPC"
- },
- "execution_count": 31,
- "outputs": []
- },
- {
- "cell_type": "code",
- "source": [
- "# 3) Training Loop\n",
- "num_epochs = 100\n",
- "\n",
- "for epoch in range(num_epochs):\n",
- " # forward pass and loss\n",
- " y_predicted = model(X)\n",
- " loss = criterion(y_predicted, y) # calculate the loss between the predictions and the ground truth labels\n",
- "\n",
- " # backward pass\n",
- " loss.backward() # backpropagates the loss through the model\n",
- "\n",
- " # update weights\n",
- " optimizer.step()\n",
- "\n",
- " optimizer.zero_grad() # sets the gradients of the model to zero\n",
- "\n",
- " if (epoch+1) % 10 == 0:\n",
- " print(f'epoch: {epoch+1}, loss = {loss.item():.4f}')"
- ],
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "fZsxw1umUgPb",
- "outputId": "577e4e97-52a6-4617-8cc1-c8dddf0f7ea4"
- },
- "execution_count": 32,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "epoch: 10, loss = 4416.8926\n",
- "epoch: 20, loss = 3295.9634\n",
- "epoch: 30, loss = 2484.5186\n",
- "epoch: 40, loss = 1896.5035\n",
- "epoch: 50, loss = 1469.9907\n",
- "epoch: 60, loss = 1160.3503\n",
- "epoch: 70, loss = 935.3738\n",
- "epoch: 80, loss = 771.7891\n",
- "epoch: 90, loss = 652.7618\n",
- "epoch: 100, loss = 566.1005\n"
- ]
- }
- ]
- },
- {
- "cell_type": "code",
- "source": [
- "# Plot\n",
- "predicted = model(X).detach().numpy() # converts prediction to numpy arrays\n",
- "plt.plot(X_numpy, y_numpy, 'ro')\n",
- "plt.plot(X_numpy, predicted, 'b')\n",
- "plt.show()"
- ],
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 430
- },
- "id": "OVVcoGigUi79",
- "outputId": "35456a6a-53ae-4545-9eb7-1bf006e55d7d"
- },
- "execution_count": 33,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/plain": [
- "