Post by gscottj on Nov 4, 2015 10:57:57 GMT -8
I'm playing around with PropNets' sizes, trying to see ways that they could potentially be reduced. (If they really are faster, but fail for big games, seems like a good place to go next.) So I've been changing the size of games and comparing sizes of resulting PropNets. For example, I took the rules of base/nim1, turned them all into strings that could be pushed at ggp-base SymbolFactory, GdlFactory, then a PropNet factory, and varied the number of heaps and the number of objects on the heaps. Although most of the variation in size of the PropNets just came from a lot more nodes for doing the math of how many objects were on the heaps (relatively little variation in size from the number of heaps), for a single set of repeated size parameters, the size of the resulting PropNet was always the same.
When I switched from varying nim1 to some non-game GDL of just, how to calculate factorials, this changed. The size of a (Legacy) PropNet for a recursive factorial, recursive addition, recursive multiplication, and successor relations up to 24 (just calculating factorial of 4, even), the size of the propnet can vary from 11000 to 13000. I'm assuming that it has something to do with the fact that I'm not actually inputting a game. No init, no goal, no roles, just GDL-syntaxed Prolog code for Peano-number addition, multiplication, and factorial. At least, I'm assuming. But that still doesn't really make sense. If there's no optimization going on, I would think that the same rules would result in the same network. There's definitely the PropNetFlattener doing what it does, but, if it sees the same input on separate runs, shouldn't it still flatten in the same way? Is there something ordered to the flattening process, and because of some intermediary data structure, it doesn't always see the List<Gdl> input in the same order as it was created?
I'm posting this here instead of as an issue on github/ggp-base, because I honestly don't know if it's an issue with the code, or what. Seems to me like it is, somehow. PropNets should be generalizable to any logic program, from what I've read about them. But maybe there's a detail about propnets, in general, or the codebase, in specific, that I'm missing, that someone here could point out to me? In the meantime, I guess I'm going to go try to make up a factorial "game," to see if the graph eventually stabilizes. One player, one move, 100 points if you pick the number that gives you the highest factorial? Sounds like fun to me. :-P
(Also: the optimizing PropNet factory always returns a graph of size 0 for factorial. I'm assuming one of its optimizations is to prune parts of the graph that aren't connected to keywords?)
When I switched from varying nim1 to some non-game GDL of just, how to calculate factorials, this changed. The size of a (Legacy) PropNet for a recursive factorial, recursive addition, recursive multiplication, and successor relations up to 24 (just calculating factorial of 4, even), the size of the propnet can vary from 11000 to 13000. I'm assuming that it has something to do with the fact that I'm not actually inputting a game. No init, no goal, no roles, just GDL-syntaxed Prolog code for Peano-number addition, multiplication, and factorial. At least, I'm assuming. But that still doesn't really make sense. If there's no optimization going on, I would think that the same rules would result in the same network. There's definitely the PropNetFlattener doing what it does, but, if it sees the same input on separate runs, shouldn't it still flatten in the same way? Is there something ordered to the flattening process, and because of some intermediary data structure, it doesn't always see the List<Gdl> input in the same order as it was created?
I'm posting this here instead of as an issue on github/ggp-base, because I honestly don't know if it's an issue with the code, or what. Seems to me like it is, somehow. PropNets should be generalizable to any logic program, from what I've read about them. But maybe there's a detail about propnets, in general, or the codebase, in specific, that I'm missing, that someone here could point out to me? In the meantime, I guess I'm going to go try to make up a factorial "game," to see if the graph eventually stabilizes. One player, one move, 100 points if you pick the number that gives you the highest factorial? Sounds like fun to me. :-P
(Also: the optimizing PropNet factory always returns a graph of size 0 for factorial. I'm assuming one of its optimizations is to prune parts of the graph that aren't connected to keywords?)