fix(AIandML): fix bugs

This commit is contained in:
iridiumR 2022-10-12 09:30:07 +08:00
parent ad034e334f
commit a912c668a9
4 changed files with 100 additions and 99 deletions

View File

@ -27,7 +27,7 @@
},
{
"cell_type": "code",
"execution_count": 43,
"execution_count": 1,
"metadata": {},
"outputs": [
{
@ -41,7 +41,6 @@
"source": [
"famous_person=\"Linus Torvalds\"\n",
"message=\"So nvidia, fuck you.\"\n",
"nHex = 0xFF\n",
"print(\"%s once said, \\\"%s\\\"\" %(famous_person, message))"
]
},
@ -64,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 2,
"metadata": {},
"outputs": [
{
@ -82,7 +81,7 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 3,
"metadata": {},
"outputs": [
{
@ -100,7 +99,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 4,
"metadata": {},
"outputs": [
{
@ -118,7 +117,7 @@
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": 5,
"metadata": {},
"outputs": [
{
@ -144,7 +143,7 @@
},
{
"cell_type": "code",
"execution_count": 48,
"execution_count": 6,
"metadata": {},
"outputs": [
{
@ -175,7 +174,7 @@
},
{
"cell_type": "code",
"execution_count": 49,
"execution_count": 7,
"metadata": {},
"outputs": [
{
@ -213,7 +212,7 @@
},
{
"cell_type": "code",
"execution_count": 50,
"execution_count": 8,
"metadata": {},
"outputs": [
{
@ -257,7 +256,7 @@
},
{
"cell_type": "code",
"execution_count": 51,
"execution_count": 9,
"metadata": {},
"outputs": [
{
@ -309,7 +308,7 @@
},
{
"cell_type": "code",
"execution_count": 52,
"execution_count": 10,
"metadata": {},
"outputs": [
{
@ -348,7 +347,7 @@
},
{
"cell_type": "code",
"execution_count": 53,
"execution_count": 11,
"metadata": {},
"outputs": [
{
@ -362,13 +361,18 @@
"City: Tokyo\n",
"country: Japan\n",
"population: 13500000\n",
"fact: Capital of Japan\n"
"fact: Capital of Japan\n",
"City: New York\n",
"country: USA\n",
"population: 53500000\n",
"fact: Biggest city of USA\n"
]
}
],
"source": [
"cities={\"Beijing\":{\"country\":\"China\", \"population\":21500000, \"fact\":\"Capital of China\"}, \\\n",
" \"Tokyo\":{\"country\":\"Japan\", \"population\":13500000, \"fact\":\"Capital of Japan\"}}\n",
" \"Tokyo\":{\"country\":\"Japan\", \"population\":13500000, \"fact\":\"Capital of Japan\"}, \\\n",
" \"New York\":{\"country\":\"USA\", \"population\":53500000, \"fact\":\"Biggest city of USA\"} }\n",
"for city, info in cities.items():\n",
" print(\"City: %s\" %city)\n",
" for k, v in info.items():\n",
@ -388,7 +392,7 @@
},
{
"cell_type": "code",
"execution_count": 54,
"execution_count": 12,
"metadata": {},
"outputs": [
{
@ -415,7 +419,7 @@
},
{
"cell_type": "code",
"execution_count": 55,
"execution_count": 13,
"metadata": {},
"outputs": [
{
@ -436,7 +440,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.10.4 ('main')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
@ -450,7 +454,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.4"
"version": "3.10.7"
},
"vscode": {
"interpreter": {

View File

@ -25,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"metadata": {},
"outputs": [
{
@ -54,17 +54,17 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"250517.08615769504\n",
"numpy:0.9500980377197266ms\n",
"250517.08615771346\n",
"for:450.66380500793457ms\n"
"250200.07698508396\n",
"numpy:0.9696483612060547ms\n",
"250200.07698508215\n",
"for:509.42516326904297ms\n"
]
}
],
@ -98,26 +98,26 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[0.832603 0.01479218 0.74726877 0.11899442 0.5139687 ]\n",
" [0.85742314 0.20950708 0.31393951 0.69463518 0.58622781]\n",
" [0.92412297 0.93890447 0.27295923 0.44996205 0.98461149]\n",
" [0.56097043 0.81885742 0.31026755 0.65530345 0.51932541]]\n",
"[[0.54243804 0.59199752 0.2088532 0.09047042]\n",
" [0.96482797 0.66663309 0.7223203 0.96680344]\n",
" [0.1848234 0.88155844 0.98424619 0.99646051]\n",
" [0.76723488 0.42095062 0.55842772 0.58467868]\n",
" [0.56045915 0.6447964 0.05470569 0.317023 ]]\n",
"[[0.98337534 1.54301691 1.01463973 1.0667643 ]\n",
" [1.58676566 1.59441744 1.05937409 1.184938 ]\n",
" [2.35467111 2.23789856 1.44499002 1.83856268]\n",
" [1.94552528 1.76219908 1.40836713 1.69937482]]\n"
"[[0.23931254 0.18071967 0.37310061 0.12620676 0.13512026]\n",
" [0.30783951 0.91376617 0.67098953 0.32039883 0.01034717]\n",
" [0.96111339 0.50345747 0.44325113 0.69203477 0.68494092]\n",
" [0.72068532 0.70385745 0.863872 0.04211034 0.64406034]]\n",
"[[0.77360967 0.69983706 0.6007846 0.86168637]\n",
" [0.81774926 0.45233242 0.25631712 0.78721015]\n",
" [0.70753124 0.97739082 0.85224573 0.38800176]\n",
" [0.99206956 0.76979289 0.32823954 0.65932597]\n",
" [0.28726144 0.0885248 0.9055978 0.25378116]]\n",
"[[0.76091893 0.72300482 0.67186089 0.61074278]\n",
" [1.78095556 1.5321393 1.10554506 1.45880543]\n",
" [2.35214635 1.9269402 1.93165995 2.02658896]\n",
" [1.97111455 1.75651195 1.94670048 1.70148712]]\n"
]
}
],
@ -147,15 +147,15 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[0.89379618 0.03735883 0.51341215 0.49607132 0.15340217]\n",
"[0.36734363 0.43023904 0.45210542 0.45422143 0.45221582]\n"
"[0.11783325 0.48074153 0.73572425 0.20476283 0.88648351]\n",
"[0.44669072 0.45593449 0.41020043 0.45832847 0.36950327]\n"
]
}
],
@ -180,38 +180,33 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[0.39753532 0.54410703 0.60167078 0.24255209 0.67574439 0.01004289\n",
" 0.55770556 0.10702142 0.48778556 0.51648967]\n",
" [0.98453781 0.66164632 0.66346184 0.5019827 0.74216596 0.37279722\n",
" 0.02415767 0.21952032 0.94425462 0.83570665]\n",
" [0.366748 0.38391583 0.21428393 0.56555728 0.73883924 0.38754266\n",
" 0.7720652 0.68972519 0.69671146 0.43759293]\n",
" [0.93430798 0.57475894 0.23919737 0.31449016 0.56069848 0.23824185\n",
" 0.61332708 0.8877036 0.895658 0.39875045]\n",
" [0.80075957 0.85481337 0.10696488 0.91660988 0.95048433 0.62219214\n",
" 0.61386599 0.1400393 0.68407094 0.08965478]]\n",
"[[-0.01653016 0.13004156 0.18760531 -0.17151338 0.26167892 -0.40402258\n",
" 0.14364009 -0.30704405 0.07372009 0.10242419]\n",
" [ 0.3895147 0.06662321 0.06843873 -0.09304041 0.14714285 -0.22222589\n",
" -0.57086544 -0.37550279 0.34923151 0.24068354]\n",
" [-0.15855017 -0.14138234 -0.31101425 0.0402591 0.21354107 -0.13775551\n",
" 0.24676703 0.16442702 0.17141329 -0.08770524]\n",
" [ 0.36859459 0.00904555 -0.32651602 -0.25122323 -0.00501491 -0.32747154\n",
" 0.04761369 0.32199021 0.32994461 -0.16696294]\n",
" [ 0.22281405 0.27686785 -0.47098064 0.33866436 0.37253881 0.04424662\n",
" 0.03592048 -0.43790622 0.10612542 -0.48829074]]\n",
"[[ 0.00000000e+00]\n",
" [ 6.66133815e-17]\n",
" [-3.33066907e-17]\n",
" [ 1.11022302e-17]\n",
" [-3.33066907e-17]]\n"
"[[0.24236313 0.55447699 0.95304607 0.79666384 0.92822022 0.27138421\n",
" 0.47722097 0.74169242 0.21323861 0.83588465]\n",
" [0.81246374 0.77727719 0.45686829 0.08864242 0.00963438 0.50045921\n",
" 0.51131599 0.1215012 0.16156761 0.9299535 ]\n",
" [0.53098614 0.39056825 0.4658711 0.26826016 0.42102393 0.11597775\n",
" 0.8880885 0.96429013 0.79650161 0.42915054]\n",
" [0.71644738 0.84851284 0.03352013 0.89332467 0.3272176 0.67425642\n",
" 0.58702405 0.39927189 0.56726108 0.92623776]\n",
" [0.30084031 0.32070728 0.05854519 0.83081661 0.70783952 0.20550454\n",
" 0.08244311 0.93941383 0.13424483 0.71656674]]\n",
"[[-0.35905598 -0.04694212 0.35162696 0.19524473 0.32680111 -0.3300349\n",
" -0.12419814 0.14027331 -0.3881805 0.23446554]\n",
" [ 0.37549539 0.34030884 0.01989994 -0.34832593 -0.42733397 0.06349086\n",
" 0.07434764 -0.31546716 -0.27540075 0.49298515]\n",
" [ 0.00391433 -0.13650356 -0.06120071 -0.25881165 -0.10604788 -0.41109406\n",
" 0.36101669 0.43721832 0.2694298 -0.09792127]\n",
" [ 0.11913999 0.25120546 -0.56378725 0.29601729 -0.27008979 0.07694904\n",
" -0.01028333 -0.19803549 -0.0300463 0.32893038]\n",
" [-0.12885189 -0.10898492 -0.37114701 0.40112441 0.27814732 -0.22418765\n",
" -0.34724909 0.50972163 -0.29544737 0.28687455]]\n"
]
}
],
@ -226,7 +221,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.10.7 ('.venv': venv)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long