cwyoo wrote:I believe BDe scoring module has been checked into Git. Let me know how to check it out and how far are we on the implementation of the module. I would ask to have the following modules in implemeting the BDe scoring module:
BDeScore(BaysianNetwork bn, Dataset ds) {
for number of nodes (indexed i) {
for number of configurations of node i's parents (indexed j) {
for number of states of node i ( indexed k) {
// get Nijk, alpha_ijk from bn and ds
// we need to have a module to getNijk(i, j, k, bn, ds)
// note that Nij = getNijk(i, j, 0, bn, ds) + getNijk(i, j, 1, bn, ds) + ... + getNijk(i, j, r_i, bn, ds)
// also alpha_ijk = 1/(r_i*q_i) and alpha_ij = 1/q_i
// add log gamma functions for Nijk, alpha_ijk in equation (35)
}
// add log gamma functions for Nij, alpha_ij in equation (35)
}
}
cwyoo wrote:cwyoo wrote:I believe BDe scoring module has been checked into Git. Let me know how to check it out and how far are we on the implementation of the module. I would ask to have the following modules in implemeting the BDe scoring module:
BDeScore(BaysianNetwork bn, Dataset ds) {
for number of nodes (indexed i) {
for number of configurations of node i's parents (indexed j) {
for number of states of node i ( indexed k) {
// get Nijk, alpha_ijk from bn and ds
// we need to have a module to getNijk(i, j, k, bn, ds)
// note that Nij = getNijk(i, j, 0, bn, ds) + getNijk(i, j, 1, bn, ds) + ... + getNijk(i, j, r_i, bn, ds)
// also alpha_ijk = 1/(r_i*q_i) and alpha_ij = 1/q_i
// add log gamma functions for Nijk, alpha_ijk in equation (35)
}
// add log gamma functions for Nij, alpha_ij in equation (35)
}
}
Michael/Abhilash, could you update me with the status on the implemtation of this module?
Michael Cho wrote:I am still working on coding up this scoring module and will be changing it to be closer to your recommended pseudocode (with some changes based on SMILE's API).
My current code uses a "refcounted_dataset" class (which contains the DSL_dataset object). Inside this class I have member functions for scoring networks, nodes, etc. Later on, derived classes can be made that will override the Nijk function (for tree-based, hash-based, etc).
On another note, I have a question on precision. Is there a large enough risk of underflow/overflow so that I should use a long double (18-decimal digits of precision on our server) rather than a double (15-decimal digits)? This changes the exponents from -308/+308 to -4932/+4932, but will increase computation time by some amount.
qja0428 wrote:The attachment is all the plots with bde score from my implementation and r, the two cde scores are not exactly the same, but they are close, I think my implementation is fine, we can move on to next: bde score with tree structure.
Users browsing this forum: No registered users and 1 guest