| 6 | |
| 7 | @attr.s |
| 8 | class Hypothesis: |
| 9 | inference_state = attr.ib() |
| 10 | next_choices = attr.ib() |
| 11 | score = attr.ib(default=0) |
| 12 | |
| 13 | choice_history = attr.ib(factory=list) |
| 14 | score_history = attr.ib(factory=list) |
| 15 | |
| 16 | |
| 17 | def beam_search(model, orig_item, preproc_item, beam_size, max_steps, visualize_flag=False): |
no outgoing calls
no test coverage detected