diff --git a/RNN_building_blocks.ipynb b/RNN_building_blocks.ipynb index 888fc62..860ee8b 100644 --- a/RNN_building_blocks.ipynb +++ b/RNN_building_blocks.ipynb @@ -19,6 +19,7 @@ "source": [ "import torch\n", "from torch.utils.data import Dataset\n", + "from torch import optim\n", "from torchvision import datasets, transforms\n", "import torch.nn.functional as F\n", "from torch import nn\n", @@ -66,7 +67,48 @@ "\n", "# mySeries dataset\n", "trainset = mySeries()\n", - "trainloader = torch.utils.data.DataLoader(trainset, batch_size=64)\n" + "trainloader = torch.utils.data.DataLoader(trainset, batch_size=64)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": 5, + "outputs": [], + "source": [ + "class RSuperviseL(nn.Module):\n", + " def __init__(self):\n", + " super().__init__()\n", + " self.fc1 = nn.Linear(1, 1)\n", + "\n", + " def forward(self, x):\n", + "\n", + " self.fc1(x)\n", + " return x\n", + "\n", + "model = RSuperviseL()" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "name": "#%%\n" + } + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "criterion = nn.MSELoss()\n", + "optimizer = optim.Adadelta(model.parameters(), lr=0.01)\n", + "num_epochs = 30\n", + "train_tracker, test_tracker, accuracy_tracker = [], [], []" ], "metadata": { "collapsed": false,