Use 'np.random' rather than 'import numpy.random as rnd'
parent
bd6c167e09
commit
692b674196
|
@ -47,11 +47,10 @@
|
|||
"\n",
|
||||
"# Common imports\n",
|
||||
"import numpy as np\n",
|
||||
"import numpy.random as rnd\n",
|
||||
"import os\n",
|
||||
"\n",
|
||||
"# to make this notebook's output stable across runs\n",
|
||||
"rnd.seed(42)\n",
|
||||
"np.random.seed(42)\n",
|
||||
"\n",
|
||||
"# To plot pretty figures\n",
|
||||
"%matplotlib inline\n",
|
||||
|
@ -779,7 +778,9 @@
|
|||
"cell_type": "code",
|
||||
"execution_count": 45,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
"collapsed": true,
|
||||
"deletable": true,
|
||||
"editable": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -793,7 +794,9 @@
|
|||
"cell_type": "code",
|
||||
"execution_count": 46,
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
"collapsed": true,
|
||||
"deletable": true,
|
||||
"editable": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -927,7 +930,9 @@
|
|||
"cell_type": "code",
|
||||
"execution_count": 60,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
"collapsed": false,
|
||||
"deletable": true,
|
||||
"editable": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -1056,7 +1061,9 @@
|
|||
"cell_type": "code",
|
||||
"execution_count": 69,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
"collapsed": false,
|
||||
"deletable": true,
|
||||
"editable": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -1083,7 +1090,9 @@
|
|||
"cell_type": "code",
|
||||
"execution_count": 71,
|
||||
"metadata": {
|
||||
"collapsed": false
|
||||
"collapsed": false,
|
||||
"deletable": true,
|
||||
"editable": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
|
@ -1195,9 +1204,9 @@
|
|||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"noise = rnd.randint(0, 100, (len(X_train), 784))\n",
|
||||
"noise = np.random.randint(0, 100, (len(X_train), 784))\n",
|
||||
"X_train_mod = X_train + noise\n",
|
||||
"noise = rnd.randint(0, 100, (len(X_test), 784))\n",
|
||||
"noise = np.random.randint(0, 100, (len(X_test), 784))\n",
|
||||
"X_test_mod = X_test + noise\n",
|
||||
"y_train_mod = X_train\n",
|
||||
"y_test_mod = X_test"
|
||||
|
|
Loading…
Reference in New Issue