diff --git a/assets/media/RL-monkey.png b/assets/media/RL-monkey.png new file mode 100644 index 0000000..64e4987 Binary files /dev/null and b/assets/media/RL-monkey.png differ diff --git a/assets/media/dseparation.png b/assets/media/dseparation.png new file mode 100644 index 0000000..e3e270e Binary files /dev/null and b/assets/media/dseparation.png differ diff --git a/demos/6. Bayesian Networks/D-separationguide/D-separation guide.rar b/demos/6. Bayesian Networks/D-separationguide/D-separation guide.rar new file mode 100644 index 0000000..d0947b7 Binary files /dev/null and b/demos/6. Bayesian Networks/D-separationguide/D-separation guide.rar differ diff --git a/demos/6. Bayesian Networks/D-separationguide/dsepar_index.html b/demos/6. Bayesian Networks/D-separationguide/dsepar_index.html new file mode 100644 index 0000000..c4a30e5 --- /dev/null +++ b/demos/6. Bayesian Networks/D-separationguide/dsepar_index.html @@ -0,0 +1,150 @@ + + + + + + + [AI] Conditional Indepence + + + +
+
+

Artificial Intelligence [HO6U1a]

+
+
+ +
+
+

Bayesian Networks: Conditional Independence

+

+ During the lectures on Bayesian networks, you were already introduced to the concept of conditional (in)dependence. + To visualize this, we can use the program Bayes Server. + Follow this link to navigate to the online application. + If you prefer an offline version, you can download it here. +

+ When you start up the Bayes Server, you see all kinds of predefined networks. + Note that you can also create your own network. For now, however, it suffices to open an existing network. + Now we will first illustrate some examples of conditional independence with the Asia network. +

+
+ Bayes Server Home Screen +
+
+

+ As you can see, the network has eight different variables, each with their own probabilities as shown in the bar graphs. + At the top, you can click on analyze and then D-Separation → D-Separation Display. +

+
+ Bayes Server D-Separation +
+
+

+ At that point a window appears where you can select the variable that will serve as the source node. + The D-separation algorithm will try to find a path from this node to all the others. + Is there an unblocked path to a node? If so, it colors green. Otherwise, it colors red. + A green node and a red node are respectively conditionally dependent and conditionally independent of the selected source node. + Now we can play around a bit by clicking on the bar graphs in the nodes. + When clicked on, these nodes become evidence. + This allows us to see which nodes become / no longer are reachable when an intermediate node becomes evidence. +

+ +
+

Now think back to the lectures. There are a total of four scenarios in which a path is blocked:

+
+ +
+

When the intermediate node is no evidence and the pattern forms a collider (both A and B point to C).

+ Bayes Server D-Separation +
+ +
+

When the intermediate node is evidence and the pattern forms a fork (C points to A and B).

+ Bayes Server D-Separation +
+ +
+

When the intermediate node is evidence and the pattern forms a chain (A points to C and C points to B).

+ Bayes Server D-Separation +
+ +
+

When the intermediate node is evidence and the pattern forms a chain (B points to C and C points to A).

+ Bayes Server D-Separation +
+ +
+
+
+

+ Practice for yourself: +
+

    +
  1. + Try reproducing the four scenarios in the opened Asia network. + Before you click the "D-Separation Display" button, try to imagine which nodes will turn green and which will turn red. + Do your expectations match the results? +
  2. +
  3. + How does the result change if you select multiple nodes as source nodes? +
  4. +
+

+
+

+ A possible example of a collider in the Asia network is the following: + Choose Has Lung Cancer as source node. + Remember that in the case of a blocked path with a collider, the intermediate node should not be a evidence. + With Tuberculosis Or Cancer as an intermediate node, we see that the path to Has Tuberculosis is blocked. +

+
+ +
+
+

+ A possible example of a fork in the Asia network is the following: + Choose Has Lung Cancer as source node. + Then choose Smoker as evidence by clicking on the bar graph. + Next, you see that the previously accessible node Has Bronchitis is now no longer accessible. +

+
+ +
+
+

+ A possible example of a chain in the Asia network is the following: + Choose Visit to Asia as source node. + Then choose Has Tuberculosis as evidence by clicking on the bar graph. + Next, you see that the previously accessible node Tuberculosis or Cancer is now no longer accessible. +

+
+ +
+
+

+ Finally, we look at what happens when we select multiple nodes as source nodes: + We choose Visit to Asia and Smoker as source nodes. + Then pick Has Tuberculosis as evidence by clicking on the bar graph. + Now take a look at Tuberculosis or Cancer. + There is a blocked path from Visit to Asia to Tuberculosis or Cancer but because the path from Smoker to Tuberculosis or Cancer is not blocked, this node is still conditionally dependent. + So if there is an unblocked path from one of the source nodes to a node, then that node is considered conditionally dependent on the source nodes. +

+
+ +
+
+

+ Don't hesitate to experiment with other networks yourself. + Try to find examples of the four scenarios in other networks. + This way, your understanding of conditional independence can only increase. +

+ +
+
+ + + + diff --git a/demos/6. Bayesian Networks/D-separationguide/dsepar_styles.css b/demos/6. Bayesian Networks/D-separationguide/dsepar_styles.css new file mode 100644 index 0000000..53968f0 --- /dev/null +++ b/demos/6. Bayesian Networks/D-separationguide/dsepar_styles.css @@ -0,0 +1,117 @@ +body +{ + font-family: Arial, sans-serif; + margin: 0; + padding: 0; + background-color: #52BDEC; +} + +.container_header +{ + max-width: 900px; + margin: 0 auto; + padding: 0 20px; + background-color: #fdfafa; +} + +.container +{ + max-width: 900px; + margin: 0 auto; + padding: 0 20px; + +} + +.header +{ + padding: 60px; + text-align: center; + background-color: #1f91c2; + color: rgb(209, 192, 192); + font-size: 30px; + } + +article +{ + background-color: #fdfafa; + border-radius: 5px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + padding: 30px; + margin: 20px 0; +} + +article h2 +{ + color: #333; +} + +footer +{ + background-color: #52BDEC; + color: #fff; + padding: 20px 0; + text-align: center; +} + +#homescreen +{ + width: 100%; + height: auto; + display: block; + box-shadow: 10px 10px rgb(105, 118, 122); +} + +#d-separation +{ + width: 100%; + height: auto; + display: block; + box-shadow: 10px 10px rgb(105, 118, 122); +} + +.blue-background +{ + background-color: #abd8e6; + color: black; /* Set the text color to black so it's readable on the blue background */ + padding: 10px; /* Add some padding so the text isn't right up against the edge of the box */ +} + +.grid-container { + display: grid; + grid-template-columns: repeat(2, 1fr); /* This creates a 2-column grid */ + gap: 20px; /* This adds some space between the grid items */ + /* This sets the background color of the grid container to blue */ + color: black; /* This sets the text color to white so it's readable on the blue background */ + padding: 10px; /* This adds some padding around the grid items */ +} + +.grid-item { + display: flex; + flex-direction: row; + align-items: center; /* This will vertically center the text and image */ + justify-content: center; /* This will horizontally center the text and image */ +} + +.grid-item img { + width: 100%; + height: auto; + margin-left: 10px; /* This adds some space to the left of the image */ +} + +#blokpad +{ + width: 30%; + height: auto; + display: block; + box-shadow: 10px 10px rgb(105, 118, 122); +} + +#example +{ + width: 70%; + height: auto; + display: block; + margin-left: auto; + margin-right: auto; + box-shadow: 10px 10px rgb(105, 118, 122); +} diff --git a/demos/6. Bayesian Networks/D-separationguide/images/blokpad1.png b/demos/6. Bayesian Networks/D-separationguide/images/blokpad1.png new file mode 100644 index 0000000..e97315d Binary files /dev/null and b/demos/6. Bayesian Networks/D-separationguide/images/blokpad1.png differ diff --git a/demos/6. Bayesian Networks/D-separationguide/images/blokpad2.png b/demos/6. Bayesian Networks/D-separationguide/images/blokpad2.png new file mode 100644 index 0000000..d45a4ef Binary files /dev/null and b/demos/6. Bayesian Networks/D-separationguide/images/blokpad2.png differ diff --git a/demos/6. Bayesian Networks/D-separationguide/images/blokpad3.png b/demos/6. Bayesian Networks/D-separationguide/images/blokpad3.png new file mode 100644 index 0000000..f37fd69 Binary files /dev/null and b/demos/6. Bayesian Networks/D-separationguide/images/blokpad3.png differ diff --git a/demos/6. Bayesian Networks/D-separationguide/images/blokpad4.png b/demos/6. Bayesian Networks/D-separationguide/images/blokpad4.png new file mode 100644 index 0000000..2495a90 Binary files /dev/null and b/demos/6. Bayesian Networks/D-separationguide/images/blokpad4.png differ diff --git a/demos/6. Bayesian Networks/D-separationguide/images/bs_d-separation.png b/demos/6. Bayesian Networks/D-separationguide/images/bs_d-separation.png new file mode 100644 index 0000000..21495ec Binary files /dev/null and b/demos/6. Bayesian Networks/D-separationguide/images/bs_d-separation.png differ diff --git a/demos/6. Bayesian Networks/D-separationguide/images/bs_homescreen.png b/demos/6. Bayesian Networks/D-separationguide/images/bs_homescreen.png new file mode 100644 index 0000000..13134d8 Binary files /dev/null and b/demos/6. Bayesian Networks/D-separationguide/images/bs_homescreen.png differ diff --git a/demos/6. Bayesian Networks/D-separationguide/images/colliderexample.png b/demos/6. Bayesian Networks/D-separationguide/images/colliderexample.png new file mode 100644 index 0000000..46415d6 Binary files /dev/null and b/demos/6. Bayesian Networks/D-separationguide/images/colliderexample.png differ diff --git a/demos/6. Bayesian Networks/D-separationguide/images/examplechain.png b/demos/6. Bayesian Networks/D-separationguide/images/examplechain.png new file mode 100644 index 0000000..2a2f863 Binary files /dev/null and b/demos/6. Bayesian Networks/D-separationguide/images/examplechain.png differ diff --git a/demos/6. Bayesian Networks/D-separationguide/images/examplefork.png b/demos/6. Bayesian Networks/D-separationguide/images/examplefork.png new file mode 100644 index 0000000..37ffc57 Binary files /dev/null and b/demos/6. Bayesian Networks/D-separationguide/images/examplefork.png differ diff --git a/demos/6. Bayesian Networks/D-separationguide/images/examplemoresources.png b/demos/6. Bayesian Networks/D-separationguide/images/examplemoresources.png new file mode 100644 index 0000000..2815db8 Binary files /dev/null and b/demos/6. Bayesian Networks/D-separationguide/images/examplemoresources.png differ diff --git a/index.html b/index.html index e43861b..daa6d31 100644 --- a/index.html +++ b/index.html @@ -435,6 +435,9 @@

4. Automated Reasoning

+ @@ -456,6 +459,18 @@

4. Automated Reasoning

style="margin-top: 2rem;" target="_blank" rel="noopener noreferrer">Open CPMpy Jupyter Lab +
+
+ +

QED is an online game that you can use to refresh your knowledge on formal logic.

+

Starting from a set of known statements, it is your job to deduce the asked logical formula by combining those you have deduced already.

+ Open + Github +
@@ -548,6 +563,9 @@

6. Bayesian Networks

+
6. Bayesian Networks style="margin-top: 2rem;" target="_blank" rel="noopener noreferrer">Open Jupyter Notebook
+
+ +

D-separation is a criterion in Bayesian networks indicating conditional + independence between sets of variables given observed variables in a directed acyclic graph.

+

This website guides you through the use of Bayes Server and more specifically how + to visualize the concepts of D-Separation while using it.

+ Open + the guide +
+
@@ -688,6 +719,9 @@

8. Markov Decision Processes

+
8. Markov Decision Processes Open GridWorld demo
+
+ RL monkey demo +

Markov Decision Processes are foundational models used in reinforcement learning.

+

Reinforcement learning involves an agent learning to make decisions by interacting with an environment, + receiving feedback through rewards or penalties based on its actions. + The agent's objective is to maximize its cumulative reward over time, guided by a reward function that quantifies the desirability of outcomes. + Additionally, a utility function is used to assess the overall desirability of different states or outcomes, + aiding the agent in selecting actions that optimize its long-term goals.

+ + Open RL Demo + +