Skip to content

Upasana dev#5

Open
upasana27 wants to merge 4 commits intomainfrom
upasana_dev
Open

Upasana dev#5
upasana27 wants to merge 4 commits intomainfrom
upasana_dev

Conversation

@upasana27
Copy link
Collaborator

Added code for computing heuristics at each timestep in step function of OvercookedEnv.

@@ -0,0 +1,60 @@
from arguments import get_arguments
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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():
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doc string please


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)]]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants