specless.automaton.mps.BMPS_search_step

specless.automaton.mps.BMPS_search_step(string: List[int], symbol: Hashable, state_probabilities: ndarray, max_string_length: int, min_string_prob: float, num_strings_to_find: int, search_heap: List, viable_strings: List, seen: set, M: ndarray, F: ndarray, one_vec: ndarray, viable_str_probabilities: set, add_entropy: bool, pbar: tqdm_asyncio)[source]

Makes one step of BMPS_exact search, updating all data structures.

Parameters:
  • string – The previous search string

  • symbol – The current symbol to try

  • state_probabilities – The probability of being in each state under the current string

  • max_string_length – The maximum viable string length

  • min_string_prob – The minimum viable string probability

  • num_strings_to_find – The number of strings to find

  • search_heap – The string search heap

  • viable_strings – The collection of viable strings, meeting all requirements to be a bmps string.

  • seen – collection of strings already searched

  • M – 3D Matrix with all transition matrices, keyed on each symbol in the 2nd axis

  • F – probability of terminating in each state

  • one_vec – d x 1 vector of ones

  • viable_str_probabilities – the set of probabilities of each viable string found thus far. needed for adding entropy.

  • add_entropy – indicates if we should add a normally viable string if it has the same sting that we have already identified as “viable”

  • pbar – tqdm progress bar

Returns:

Updated data structures and if we have enough viable strings