pytorch-stuff/Manual-Neural-Network.ipynb

159 lines
2.5 KiB
Plaintext
Executable File

{
"cells": [
{
"cell_type": "code",
"execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
"class SimpleClass():\n",
" \n",
" def __init__(self,name):\n",
" print(\"Hello\"+ ' ' +name)\n",
" \n",
" def yell(self):\n",
" print(\"YELLING!!!\")"
]
},
{
"cell_type": "code",
"execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"s = \"world\""
]
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"str"
]
},
"execution_count": 27,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(s)"
]
},
{
"cell_type": "code",
"execution_count": 28,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello Ed\n"
]
}
],
"source": [
"x = SimpleClass('Ed')"
]
},
{
"cell_type": "code",
"execution_count": 29,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"YELLING!!!\n"
]
}
],
"source": [
"x.yell()"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
"class ExtendedClass(SimpleClass):\n",
" \n",
" def __init__(self):\n",
" super().__init__('Eddie')\n",
" print(\"EXTEND\")"
]
},
{
"cell_type": "code",
"execution_count": 31,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello Eddie\n",
"EXTEND\n"
]
}
],
"source": [
"y = ExtendedClass()"
]
},
{
"cell_type": "code",
"execution_count": 32,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"YELLING!!!\n"
]
}
],
"source": [
"y.yell()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### "
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 4
}