diprism / fggs

Factor Graph Grammars in Python
MIT License
13 stars 3 forks source link

make bin/sum_product.py compute gradients and expectations #147

Closed davidweichiang closed 2 years ago

davidweichiang commented 2 years ago

and improve help message and error messages

ccshan commented 2 years ago

I appreciate the new features as well as the improved usability! My only complaint is that E[{name}] (such as E[tick]) doesn't seem like the usual notation for this "how many times was tick sampled from, assuming its weight is 1" trick. Can we better explain this feature or notate its output? (Is this trick some folklore documented somewhere?)

davidweichiang commented 2 years ago

The trick is from


author = {Darwiche, Adnan},
title = {A Differential Approach to Inference in {B}ayesian Networks},
year = 2000,
booktitle = "Proc. UAI",
pages = "123--132",
}```

Would E[c(tick)] be better?
ccshan commented 2 years ago

Ah! How about E[#tick]? For me it would have the effect of warning me that I don't know what's being computed (unlike some familiar notation E[tick]) and I should look for additional documentation as to what's being computed.

davidweichiang commented 2 years ago

Hi, can either @ccshan or @HerbertMcSnout approve?