Open paraschopra opened 3 months ago
Usually this happens because the grammar definition is improper, in the sense that the expected length is infinite. That happens when rules where nonterminals go to other nonterminals have too high of a value.
So, you can try increasing the probability of nonterminals expanding to terminals.
Thanks! I read that internally python recurses stack 999 times, so maybe this is what's happening.
btw @piantado do you have any tips on how to think of probabilities?
also, i noticed fleet has enumerator but lotlib3 doesn't have (it only has MCTS). Any reason? While trying to induce programs for given input/output, isn't enumeration better? I imagine MCTS wastes a lot of cycles iterating over same programs that don't fit the data
Can you guide me how to enumerate programs? I don't see any basic sampler other than Metropolis Hastings in the library.
Yes the error comes from python reaching its recursion limit, but the reason that happens is that the grammar assigns probability to infinitely big trees if the probability on terminals is too low. So if you increase the probability on terminals, your prior will put more mass on small trees, and eventually give zero mass to infinite ones.
Yep, I did that and now the error is no more.
I'm running into this for my custom grammar. (PS: Trying to reproduce list processing task of DreamCoder).
Any tips on how to approach grammar definition that avoids this?