{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "5ea243e3-7f3f-4181-814b-b964b413d43d",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/jovyan/work/d2l/notebooks/d2l.py:119: SyntaxWarning: assertion is always true, perhaps remove parentheses?\n",
" assert(self, 'net'), 'Neural network is defined'\n",
"/home/jovyan/work/d2l/notebooks/d2l.py:123: SyntaxWarning: assertion is always true, perhaps remove parentheses?\n",
" assert(self, 'trainer'), 'trainer is not inited'\n"
]
}
],
"source": [
"import random\n",
"import torch\n",
"import d2l\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from torch import autograd\n",
"import warnings\n",
"warnings.filterwarnings(\"ignore\")"
]
},
{
"cell_type": "markdown",
"id": "4afb1d6a-795b-40cd-9649-f8dfd1f94fcb",
"metadata": {},
"source": [
"# 3.4.6. Exercises"
]
},
{
"cell_type": "markdown",
"id": "1e8108cf-40cf-46df-92b1-b9dec8b024eb",
"metadata": {},
"source": [
"## 1. What would happen if we were to initialize the weights to zero. Would the algorithm still work? What if we initialized the parameters with variance 1000 rather than 0.1?"
]
},
{
"cell_type": "markdown",
"id": "d4c1ddac-e27e-496a-a57c-cbf1c9a57fac",
"metadata": {},
"source": [
"### origin model(initialize the weights with norm(0,0.01))"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "172a12b0-698d-4a33-811b-7f70a89912a2",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n"
],
"text/plain": [
"