Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close
Tema 3 AI  |  Iulius Curt  343 C3
---------------------------------
(varianta A)


Rulare:
    - python main.py


Configurare input:
    - in 'main.py' se seteaza calea fisierelor in variabilele globale:
        - IN_FILE  - fisier de intrare cu specificarea retelei
        - QUERY_FILE  - fisier de intrare cu interogari
        - ANSWER_FILE  - fisier de iesire cu raspunsuri


Surse:
    - main.py  - parsare input, instantiere structuri, afisare rezultat
    - bayesnet.py  - implementarea structurilor 'Variable', 'Factor' si 'BN'
    - inference.py  - implementeaza functia de 'VariableElimination' si o
                        functie de ordonare a variabilelor


Functia de ordonare a variabilelor:
    - ordine crescatoare a numarului de variabile in factorul obtinut dupa
      eliminarea variabilei curente


Variable-Elimination:
    - se aplica numarator si pe numitor dupa ce probabilitatea conditionala
      este sparta: P(A,B|C,D,E) = P(A,B,C,D,E) / P(C,D,E)
    - se ordoneaza variabilele ascunse (neinstantiate de interogare)
    - se reduc variabilele din conditia interogarii (a caror valoare se
      cunoaste)
    - in ordine, pentru fiecare variabila ascunsa:
        - se reduc prin inmultire toti factorii ce contin variabila
        - se reduce variabila prin sumare pe intregul ei domeniu
    - in final ramane o distributie de probabilitate doar pe variabilele de
      interogare
    - se alege din acea distributie de probabilitate valoarea corespunzatoare

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.