New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incomplete documentation for add_factor #115
Comments
Thanks for bringing this up! This is actually a bug in the documentation. This bug in the documentation was a result of copying the docstring for See Line 82 in 2d86b75
add_factor . factor_configs and log_potentials should be a literal translation of factor definitions (see for example Tables 1 and 2 in the blog post).
|
Thank you for working on it! Note that we'll still need to know which element of the array of shape |
If the arrays containing the correct data don't already exist, I assume you should be able to create the necessary arrays in the right format easily (e.g. maybe you allow all possible combinations in which case you can use The package only helps you specify the model once the factor definitions are clear. If it's unclear what value to use for each configuration that sounds like the factor definition is still unclear, and more work is needed to clarify how to define the factor but that is on the modeling side and is orthogonal to how |
The values to use for each factor are perfectly clear in my mind, that isn't the issue at all. I'm actually just trying to implement something simple like the sprinkler example, because that's a more useful starting point for me than the complex machine learning examples in the blog post. The actual issue is that I hadn't understood that the valid configurations are stored in a list with an arbitrary order, instead of exhaustively. This is partly because the documentation doesn't say what |
Yes. The main reason for explicitly enumerating the valid configurations is to support non-standard factors (e.g. the RCN example or structured higher-order factors, where only a small number of all possible configurations are valid). We tried to mention this and define Line 112 in f7f3e3f
For the usual pairwise factors with an exhaustive list of configurations one can use Line 127 in f7f3e3f
Line 814 in f7f3e3f
log_potential_matrix . See Line 110 in f7f3e3f
We will add additional clarifications in the |
Thank you! I am afraid I am still completely confused. Here is some code that's attempting to create a factor graph corresponding to a simple Bayesian network and add the first of two factors. However, on running it I get an error, pasted below, which I don't understand. I must still be misunderstanding something about how these functions are meant to be used.
Here is the error:
This doesn't make sense to me because I would have thought a name is just an arbitrary string, but if I try giving them longer names instead the error changes to this:
|
Doing it the following way solves my problem. I would say this is also an issue with the documentation for add_factor. The documentation says
But in fact (In this case I had to split the variables into two groups because they don't have the same number of outcomes. This strikes me as a bit awkward, so I've posted a separate issue about it.)
|
Thanks for raising these questions! It's very helpful to know what is confusing the users, and we will enhance the documentation accordingly. For your questions:
When you construct the factor graph with |
The documentation for
add_factor
currently says:However, in order to use it one would need to know the order in which the factors should be specified. Could this be added to the documentation?
The text was updated successfully, but these errors were encountered: