@@ -51,7 +51,7 @@ using TensorInference
5151# Load the ASIA network model from the `asia.uai` file located in the examples
5252# directory. See [Model file format (.uai)](@ref) for a description of the
5353# format of this file.
54- model = read_model_file (pkgdir (TensorInference, " examples" , " asia" , " asia .uai" ))
54+ model = read_model_file (pkgdir (TensorInference, " examples" , " asia-network " , " model .uai" ))
5555
5656# ---
5757
@@ -60,8 +60,8 @@ tn = TensorNetworkModel(model)
6060
6161# ---
6262
63- # Calculate the partition function.
64- # Since the factors in this model is normalized, the partition function is the same as total probability, $1$.
63+ # Calculate the partition function. Since the factors in this model are
64+ # normalized, the partition function is the same as the total probability, $1$.
6565probability (tn) |> first
6666
6767# ---
@@ -71,13 +71,13 @@ marginals(tn)
7171
7272# ---
7373
74- # Retrieve the variables associated with the tensor network model.
74+ # Retrieve all the variables in the model.
7575get_vars (tn)
7676
7777# ---
7878
79- # Set an evidence: Assume that the "X-ray" result (variable 7) is positive.
80- # Since setting an evidence may affect the contraction order of the tensor
79+ # Set the evidence: Assume that the "X-ray" result (variable 7) is positive.
80+ # Since setting the evidence may affect the contraction order of the tensor
8181# network, recompute it.
8282tn = TensorNetworkModel (model, evidence = Dict (7 => 0 ))
8383
@@ -88,8 +88,7 @@ maximum_logp(tn)
8888
8989# ---
9090
91- # Generate 10 samples from the probability distribution represented by the
92- # model.
91+ # Generate 10 samples from the posterior distribution.
9392sample (tn, 10 )
9493
9594# ---
0 commit comments