Avoid risk of running example code
Put the example code in a markdown cell so that it can't be easily accidentally run.
This commit is contained in:
parent
929237301b
commit
c2af708221
@ -72,15 +72,14 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"cell_type": "code",
|
"cell_type": "markdown",
|
||||||
"execution_count": null,
|
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"collapsed": false
|
"collapsed": false
|
||||||
},
|
},
|
||||||
"outputs": [],
|
|
||||||
"source": [
|
"source": [
|
||||||
|
"Example code for the above\n",
|
||||||
|
"```python\n",
|
||||||
"# %load -s Linear mlp/layers.py\n",
|
"# %load -s Linear mlp/layers.py\n",
|
||||||
"# DO NOT RUN THIS CELL (AS YOU WILL GET ERRORS), IT WAS JUST LOADED TO VISUALISE ABOVE COMMENTS\n",
|
|
||||||
"class Linear(Layer):\n",
|
"class Linear(Layer):\n",
|
||||||
"\n",
|
"\n",
|
||||||
" def __init__(self, idim, odim,\n",
|
" def __init__(self, idim, odim,\n",
|
||||||
@ -193,7 +192,8 @@
|
|||||||
" self.b = params[1]\n",
|
" self.b = params[1]\n",
|
||||||
"\n",
|
"\n",
|
||||||
" def get_name(self):\n",
|
" def get_name(self):\n",
|
||||||
" return 'linear'\n"
|
" return 'linear'\n",
|
||||||
|
"```"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -295,7 +295,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython2",
|
"pygments_lexer": "ipython2",
|
||||||
"version": "2.7.9"
|
"version": "2.7.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
Loading…
Reference in New Issue
Block a user