in agent/affordance_extractors/lm_affordance_extractor.py [0:0]
def __init__(self):
super().__init__()
self.lib = CDLL(LM_READER_PATH)
self.configure_ctypes(self.lib)
self.forward_model = self.open_language_model(FORWARD_LM_PATH)
self.affordable_attributes = []
self.affordable_attributes_by_name = {}
self.attribute_probs = {}
self.num_commands_to_return = 30
self.cached_unknown_actions = {}
self.cached_extractions = {}
self.init_affordable_attributes()
self.get_log_prob_calibration_thresholds()
self.unknown_action_extraction_threshold = 0.4
self.double_object_action_lp_offset = 12. # Higher numbers give higher probs.
self.double_object_action_lp_scale = 2.0 # Higher numbers give wider prob variance.
self.double_object_action_extraction_threshold = 0.05 # Probably good to match the Idler's eagerness.
self.cached_double_object_actions = {}
self.action_prior_table = {}
self.filtered_action_list = []
self.read_action_priors()