You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had this problem. I found out that this happens when in the PriorityQueue(PQ) two elements have the same value then, the algorithm moves to the element itself. Because the element in the PQ is an object it generates this Error.
The solution was that I add in the class a special function to handle this by choosing the element with the highest probability., as follows. If this seems ok to you, you can add this lines in your code. Or I can make a pull request.
#function in the class BeamSearchNode
def __lt__(self, other):
return self.prob < other.prob
The text was updated successfully, but these errors were encountered:
gionanide
changed the title
Test TypeError: '<' not supported between instances of 'BeamSearchNode' and 'BeamSearchNode'
TypeError: '<' not supported between instances of 'BeamSearchNode' and 'BeamSearchNode'
Oct 18, 2019
@gionanide Hey bro,I think this is the property of the class "PriorityQueue". If you want to use it with the class you define by yourself, you may want to override the it method. Anyway, just some supplement~
I had this problem. I found out that this happens when in the PriorityQueue(PQ) two elements have the same value then, the algorithm moves to the element itself. Because the element in the PQ is an object it generates this Error.
The solution was that I add in the class a special function to handle this by choosing the element with the highest probability., as follows. If this seems ok to you, you can add this lines in your code. Or I can make a pull request.
The text was updated successfully, but these errors were encountered: