Conversation
| @@ -0,0 +1,60 @@ | |||
| from arguments import get_arguments | |||
There was a problem hiding this comment.
Please create a PR with just the heuristics file (i.e. branch of current main, add the heuristics file, and then create the PR)
| self.grid = grid | ||
| self.terrain_mtx = self.grid.terrain_mtx | ||
| self.planner = mlam | ||
| def heuristic_1(self): |
There was a problem hiding this comment.
please give this a better name and provide a doc string explaining the logic in english.
| from torch.utils.data import Dataset, DataLoader | ||
| from tqdm import tqdm | ||
|
|
||
| class Heuristic(): |
There was a problem hiding this comment.
All heuristics should return a scalar number for the alternatives they are ranking. In this case, we are ranking possible subtasks, so the output of each heuristic function here should be dictionary where the keys are the subtasks labels and the values are their scalar "worth". (if you prefer, an ordered list of the values is also acceptable, as long as the order is clear).
| heuristic1.append(distance_heur) | ||
| return heuristic1 | ||
|
|
||
| def heuristic2(self, history0, history1): |
|
|
||
| def heuristic2(self, history0, history1): | ||
| # dividing by history to find task probabiity | ||
| task_counter_sum = [ [sum(x)/ len(history1) for x in zip(*history0)], [sum(x)/ len(history1) for x in zip(*history1)]] |
There was a problem hiding this comment.
what are x and history here? The output should be a scalar value for each subtask, so counting how many each has happened so far is only half the logic
Added code for computing heuristics at each timestep in step function of OvercookedEnv.