0 ratings 0% found this document useful (0 votes) 31 views 2 pages AI8
The document outlines the installation process of various NVIDIA CUDA packages and dependencies in a Python environment, primarily for use in a Colab notebook. It also describes the setup of a Bayesian network model, including defining variables and conditional probability distributions. Finally, it demonstrates how to perform inference to compute probabilities based on different evidence inputs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
2ner2s, 11:27 aM ‘Unttled6.pynd -Colab
Fy __ Downloading nvidia_cude_cupti_cu12-12.4.127-py3-none-nanjlinvx261¢_xB6_64.whl.netadata (1.6 K8) -
coltect'== i" veadeneeaL2ea974.0.78 (ron toreh Par)
2°" 1g euanneui2-9. 2.8. 70-py-nonernany InU2014 86 Gt. wh.netadats (2.6 40)
Collecting eviia-cublas-cal2==i2.4.5.8 (from toreh->paNPy)
Downoseing avidia_cublas_pENpY)
Downboacing nvidia_curand_cul2-10,3,5,1A7-pys-none-ranylsnox2014 3B6,64,whl.nataeats (1.5 K8)
cotlecting nvidia-cusolver-cil2--42-6-1.9 (eran terch->penpy)
Collecting rvidia-cusparse-culzsea2.3.1.178 (fron torch >PBNBY)
Downtonsing nvidia. cusparse_cu2-12,3.1.470epy-none-nonylinox2616_x86_68.wn. metadata (1-6 KB)
feguironent slready Zatisfied> nwsdigencei-cuizen2_ 21.5 an /vsr/locai/1b/pyemons.13/aist-packages (From torch
Requirenent already satisfied: qyidia-nvtx-cul2oci2.4.127 in /ust/local/2i6/eythend.21/aiat-packages (From tore
Collecting rvidia-nejitlink-cutzee12.4.127 (fron torch->PRNpY)
Downoacing avidia_nyjicLink_cu2-i2.4,127-py3-none-ranylinDx2616_xB6_64.Wnnetacata (15 KB)
fequironent already satisfied: tritoneo3-1.0 sm /usr/loeai/b/aytnans.i2/stat packages (fr0e toreh-penpy) (3-1-8)
equirenent alread) Satisfied: syepyort.13-1 in /ust/locai/ib/aython3.22/aist-packages (#ror torch->2gR9y) (223-2)
Requirenent already Satisfied: apnethel.4, 1.2.8 In /usr/local/ib/pyeher3.11/dist-packages (fron syrpy-~t-t3-1->tocch->PENpy) (
Requirenent already Satisfied: googleapis-conror-protose2-0,dev0,>=1.95.2 in /usr/local/Lib/python3.11/dist-packages. (from google
Requirenent already satisfied: requestscd.0.0.dev®, 2.28.0 in /usr/iocsi/1i6/pythond.31/dist-packages (fran
Requisenent slready satisfied: cachetoolacé.0,9-2,6.0 in /usr/local/lib/pytnon®.44/dia
Requirenent already satistied: pysentcnodvless-0.2.1 in /usr/local/lsb/pysnon3. 12/8 :
fequirenent already satisfied: reacs,o03.1.4 an /usr/locol/Iib/aythons./ctse-packages (fron poogle-auth>=2_15-0-sgoopie-penerat
fequienent already satisfied: sixo-1.5 in /urr/loeal/ib/python) 11/dist-paceages, (fram python-aatevtil%-2.8.2-dpanda-9pENpY) (
Requirenent alread) Satisfied: hteplitz=8.19.0 in /usr/local/ib/python5.12/4ist-packages (#re0 google-api-python-cLieat
Requirenent already satisfied: google-auth-nttplibicl.0.0,>00,2-0 in /ust/local/ib/pytnons.12/dist-packages, (Fran google-opS-3yt
Requirenent already Satisfied: ursteyplatecs, "3.8.1 in /ust/local/Iab/pyzhor3.11/é8st-packages (fron google-2p1-python-clier®-g
Requirenent already satisfied: Markupsare>=2-0 in /ust/local/1/aython’.12/aist-packages (Fron Jinja2eotoreh-98n29) (2-9-2)
Requienent already satisfied ed-types)=0.6.8 in /usr/lacal/1ib/python3.24/hst-packages: (Fran pydantic->goagle-generatiy
Requirenent already Satisfied: pycantie-corese2.27-2 in /usr/local/ib/pythons-ii/éist-packages (row pydanthc->googie-gener ative
fequironent already satisfied: grpetoe? @dev,>-i.23.2 in /usr/loeal/Isb/pytnons.1/aist-packages (Fron google-aPi=core[Erpe 2.2
fequironent already satisfied: grpctonstatuse20.dev0,d-1-33.2 in /usr/oeal/ib/pythond.11/dsst-packages (fron google spf-corel
fequirenent already Satisfied: ‘4.5 1" /usr/local/lib/python3.11/4ist- packages (Fron pyasnt-nodsLe goog)
Requirenent already Satisfied Szercade2 An /usr/local/sb/pytions.13/@ise-packapes (FOR nequestS«3.0.0.60¥8, >
Requirenent already Satisfied: Anacd,>-2.5 in /usr/local/lib/python3../aist-packages (Fron requestsc3-0,0.cev®,9-2.18.0->g20gle
Requirenent alread) Satisfied: upiiin3¢3,y=1.22.1 in /usr/iocal/1i4/python3.11/dist-packages (fron requests<3.0.0,dev0,>=2-18
a6 0)
peroy) (2.21.5)
“boaroy) (42.8.12
Requirenent already Satisfied: certifin=2017-4.17 in /Usr/lecal/lie/pythend 1i/dist-packages (fron hequestsc3.0.0.dev0,>=2.18.2->
Bewnloating pgroy-0.2.26-py3-none-any.wil (2.0 MB)
072.0 10 16.6 v/s eta 0:00:08
ownoading qvidia_cublay_cv12-22.4.5.82py3-none-nanylinunz0i4 x86 6¢.nhl (363.4 MB)
—_Erseveeeeeeepeae/ach-a ma 30°mB/3 ecu 8:00:06
ownloading wvidia_cude_cupth_cul2-12,4,127-py3-none-ranylinodelex86_64.¥M] (3.8 48)
—s—~—~—'«”ssv wv. 8/ 33.0 a8 Hb / 89 0:00:00
Downloading vida _cuda_pvrte_cul-12.4.127-pyS-rone-nanyiinwd14_y86_64.] (24.6 M8)
eS F.6/6 MO 32 Mola eta 0:00:00
widia_cuda_ pontine cvi2-12,4.227-py3-none-nanylin2016 x85_64.Wh (563 KB)
1985.7/68),7 158.9 M/s eta 0:00:00
vidia_cudnn_ev2-9.4.0,7@-pyi-nane-nanylinn2024 x86, enh) (6.9 HO)
154./664.8 2 2-0 MG/s eta @:00:00
Downloading wvidia_curte_cv12-11,2.1,3-p93-none-nanylinvx2014_x86_6¢.wh (211.5 M6)
——<—~——v—“"vvi1™”s rr vmeemptn_5/ 224-6 Ha Sk MBT® a 0:00:00
ownioading wvidia_curand_co12-20.3.5.187-py3-rone-wanylinunde4 86 6h] (36.3 M8)
—_eeeewee wr I3/56.2 Mo 10.3 Mele eta 0:00:00
oownloading wvidia_cusolver_cuiz-1.6.1,9-py3-none-ranylsnux2014_x86,64.aR] (127.9 M8)
127.9/527.9 WB 76 WB) een 6 LI
4 Importing necessary sodules
‘from pgnpy.nodels tapert Gayestanhetwork
4 Define the structure of the @ayesian Network
yesiametwork([(*Rain", “hetSrass), (Sprinkler, “wetsrass")])
4 betine the Conditional Probability Distributions (cPDs)
1 (Rain)
cod_rain = Tabularceo(vartables'Rain’, variable carée2, valuese((0.7), (8:3]])
4 %¢Sprinkier)
{pd_sprinkler = TabulerCho(variable="Sprinkler*, varfable_ca
5, valuese([0.81, [0.211)
1 etuetsrass | Rain, sprinkler)
wetgrass = TabularcPo(variables"MetGrass', variable
valuess[[0.99, 8.9, 8.9, 9.0)
eles, 1, 0.3, 2.8)},
levidencee['Rain", Sprinkler’,
-nps:feolab research google.comisrvelE1IAisoVU0-BYds220200k62IPDVUVZikscrolTo=HORNE}E_n_RbSprniMode=tue aanaes, 11:27 AM Unttled6.pynd -Colab
cevidence_earée[2, 21)
1 Aaa cos to te rode
model. ade_epds(cod_rain, cpd_sorinkler, cod wetgrass)
rode check,
18 benforn inference
inference = Variabletlinination(rodel)
# Exanple of conputing the probability of KetGrass given that It t8 raining
prob wetgrass_given_rain = inference.cuery(variabless[WwetGrass], evidence
Brint(prob_wetarass given r3in)
kein’: 19)
1 exanple of conputing the probsbility of KetGrass given that the sprinkler 4s on
prob wetgrass_given sprinkler = inference. query(vartablese[ ‘etGrass"], evidencen{ Sprinkler": 1)
print (prob wetgrass_given, sprinkler)
4 branpe: What 15 the probability of WetGrass given both Rain and Sprinkler?
prom_wetgress_given_both = inference,cuery(arsablese[ wesGraes"], evidencee(Rein': 1, *Sprinkler’: 1))
Brint(preb_wetgrass_given_toth)
Q
crass | phi(uetcrass) |
i
1 wetcrase(3) | eaee |
-nps:fcolab. research google.comisrvelE1IAss0VU0-8Yds220200k62IPDVUVZkscrolTo=HORNE}E_n_RbSprniMode=tue
22