iglu.tasks package
Submodules
iglu.tasks.load module
- iglu.tasks.load.download_file_from_google_drive(id, destination, data_prefix)
- iglu.tasks.load.get_confirm_token(response)
- iglu.tasks.load.save_response_content(response, destination, data_prefix)
iglu.tasks.task module
iglu.tasks.task_set module
- class iglu.tasks.task_set.CustomTasks(goals: List[Tuple[str, numpy.ndarray]])
Bases:
iglu.tasks.task_set.TaskSet
TaskSet that consists of user-defined goal structures
- Parameters
goals (List[Tuple[str, np.ndarray]]) – list of tasks. Each task is represented by a pair (string conversation, 3d numpy grid)
- class iglu.tasks.task_set.RandomTasks(max_blocks=4, height_levels=1, allow_float=False, max_dist=2, num_colors=1, max_cache=0)
Bases:
iglu.tasks.task_set.TaskSet
TaskSet that consists of number of randomly generated tasks
- Parameters
max_blocks (
int
) – The maximal number of blocks in each task. Defaults to 3.height_levels (
int
) – How many height levels random blocks can occupy. Defaults to 1.allow_float (
bool
) – Whether to allow blocks to have the air below. Defaults to False.max_dist (
int
) – Maximum (Chebyshev) distance between two blocks. Defaults to 2.num_colors (
int
) – Maximum number of unique colors. Defaults to 1.max_cache (
int
) – If zero, each .sample_task will generate new task. Otherwise, the number of random tasks to cache. Defaults to 0.
- dump(path)
- load(path)
- sample()
- sample_task()
- set_task(task_id)
- class iglu.tasks.task_set.TaskSet(preset='simplest', task_id=None, update_task_dict=False)
Bases:
object
- ALL = {'C1': 'bell (29 blocks, 5 colors)', 'C10': 'concentric_semicircles (21 blocks, 3 colors)', 'C100': 'wannabe_olympic_rings (42 blocks, 4 colors)', 'C101': 'connected_tunnels (31 blocks, 3 colors)', 'C102': 'man_on_broom (16 blocks, 4 colors)', 'C103': 'rotating_chair (19 blocks, 1 colors)', 'C104': 'clothesline (36 blocks, 2 colors)', 'C105': 'lol_ethylene (34 blocks, 3 colors)', 'C106': 'minimal_tree (18 blocks, 2 colors)', 'C107': 'colorful_alien (20 blocks, 3 colors)', 'C108': 'illinois-i (29 blocks, 2 colors)', 'C109': 'waving-flag (11 blocks, 2 colors)', 'C11': 'broken_heart (21 blocks, 2 colors)', 'C110': 'color-loop (16 blocks, 4 colors)', 'C111': 'color-cube (16 blocks, 4 colors)', 'C112': 'color-spiral (33 blocks, 5 colors)', 'C113': 'numbers (43 blocks, 4 colors)', 'C114': 'e3 (18 blocks, 2 colors)', 'C115': 'hollow_stools (23 blocks, 4 colors)', 'C116': 'diagonal_arch_and_triangle (17 blocks, 4 colors)', 'C117': 'pyramid_with_horns (20 blocks, 4 colors)', 'C118': 'random_objects_3 (12 blocks, 2 colors)', 'C119': 'funny_chair (38 blocks, 3 colors)', 'C12': 'diagonal-Ls (18 blocks, 6 colors)', 'C120': 'h_1_plus (14 blocks, 2 colors)', 'C121': '2d_giraffe (19 blocks, 3 colors)', 'C122': 'funny_bird (25 blocks, 4 colors)', 'C123': 'footballer (26 blocks, 3 colors)', 'C124': 'connected_triangles_2 (29 blocks, 3 colors)', 'C125': 'fail_hourglass (22 blocks, 3 colors)', 'C126': 'teapot (20 blocks, 2 colors)', 'C127': 'backpack (26 blocks, 3 colors)', 'C128': 'weird_chain (16 blocks, 4 colors)', 'C129': 'rhombuses_with_ring (34 blocks, 3 colors)', 'C13': 'eye (29 blocks, 3 colors)', 'C130': 'differently_oriented_squares (24 blocks, 2 colors)', 'C131': 'table_with_objects (35 blocks, 6 colors)', 'C132': 'diagonal_slab_with_pattern (20 blocks, 2 colors)', 'C133': 'adjacent_gates (28 blocks, 3 colors)', 'C134': 'parachute (28 blocks, 6 colors)', 'C135': 'bent-arrow (11 blocks, 1 colors)', 'C136': 'waving-man (17 blocks, 4 colors)', 'C137': 'no-u-turn (39 blocks, 2 colors)', 'C138': 'color-Us (42 blocks, 6 colors)', 'C139': 'minimalistic-mouse (16 blocks, 3 colors)', 'C14': 'diagonal-zigzag (16 blocks, 3 colors)', 'C140': 'weird-rows (28 blocks, 4 colors)', 'C141': 'dancing-banana (19 blocks, 4 colors)', 'C142': 'potted-weeds (28 blocks, 3 colors)', 'C143': 'drooping-flower (21 blocks, 5 colors)', 'C144': 'curly-R (20 blocks, 3 colors)', 'C145': 'pulse (19 blocks, 1 colors)', 'C146': 'boxy-to-diagonal (17 blocks, 5 colors)', 'C147': 'pi (26 blocks, 4 colors)', 'C148': 'headphones (40 blocks, 4 colors)', 'C149': 'drink-with-umbrella (37 blocks, 4 colors)', 'C15': 'double_stairs (36 blocks, 4 colors)', 'C150': 'checkerboard (16 blocks, 6 colors)', 'C151': 'hanger (16 blocks, 3 colors)', 'C152': 'ballerina (24 blocks, 3 colors)', 'C153': 'cursive-ok (27 blocks, 2 colors)', 'C154': 'gateway-to-stairs (52 blocks, 6 colors)', 'C155': 'sickles-difficult (24 blocks, 2 colors)', 'C156': 'sun_and_birds-difficult (19 blocks, 2 colors)', 'C157': 'butterfly-difficult (24 blocks, 3 colors)', 'C16': 'bloody-sword (24 blocks, 4 colors)', 'C17': 'orange-flat-original-L (3 blocks, 1 colors)', 'C18': 'overlapping-reticles (12 blocks, 3 colors)', 'C19': 'slide_with_arch (48 blocks, 3 colors)', 'C2': 'black-hole (20 blocks, 2 colors)', 'C20': 'rainbow-lasso (9 blocks, 6 colors)', 'C21': 'spectacles (29 blocks, 2 colors)', 'C22': 'smiley (6 blocks, 5 colors)', 'C23': 'suspension_bridge (68 blocks, 4 colors)', 'C24': 'cup (46 blocks, 4 colors)', 'C25': 'music-notes (18 blocks, 2 colors)', 'C26': 'rainbow-diagonal-stack (15 blocks, 6 colors)', 'C27': 'funny-Ts (25 blocks, 4 colors)', 'C28': 'duck (21 blocks, 2 colors)', 'C29': 'tetris (20 blocks, 5 colors)', 'C3': 'blue-original-L (3 blocks, 1 colors)', 'C30': '3d-triangle (20 blocks, 6 colors)', 'C31': 'hot (20 blocks, 3 colors)', 'C32': 'bigger-original-L (5 blocks, 1 colors)', 'C33': 'connected_diamonds_with_missing_blocks (14 blocks, 2 colors)', 'C34': 'complex_five (13 blocks, 3 colors)', 'C35': 'strange-triangles (20 blocks, 6 colors)', 'C36': 'street_lamps (31 blocks, 3 colors)', 'C37': 'embedded_fives (56 blocks, 6 colors)', 'C38': 'l-shape', 'C39': 'three-squares (24 blocks, 3 colors)', 'C4': 'flower_new (17 blocks, 4 colors)', 'C40': 'cross-stack (9 blocks, 6 colors)', 'C41': 'multiple_concepts (19 blocks, 3 colors)', 'C42': 'rubiks (18 blocks, 4 colors)', 'C43': 'girl_with_frock (29 blocks, 3 colors)', 'C44': 'hollow_diseased_rectangle (19 blocks, 4 colors)', 'C45': 'u-3 (14 blocks, 2 colors)', 'C46': 'wtf (11 blocks, 6 colors)', 'C47': 'staircase (18 blocks, 3 colors)', 'C48': 'umbrella (37 blocks, 4 colors)', 'C49': 'letter-cube (36 blocks, 4 colors)', 'C5': 'overlapping-chain-links (20 blocks, 2 colors)', 'C50': '3d-x_s (15 blocks, 3 colors)', 'C51': 'interlocking-magnets (16 blocks, 4 colors)', 'C52': 'hut_and_trees (31 blocks, 3 colors)', 'C53': 'funny-cube (20 blocks, 4 colors)', 'C54': '3d-diagonals (10 blocks, 3 colors)', 'C55': 'chains (19 blocks, 3 colors)', 'C56': 'color-wheel (25 blocks, 4 colors)', 'C57': 'four-three (17 blocks, 2 colors)', 'C58': 'ducks_in_pool (24 blocks, 2 colors)', 'C59': 'parallel-bars (20 blocks, 4 colors)', 'C6': 'rectangle-chain (40 blocks, 4 colors)', 'C60': 'diagonal-2 (20 blocks, 6 colors)', 'C61': 'chair2 (19 blocks, 2 colors)', 'C62': 'chair3 (32 blocks, 3 colors)', 'C63': 'question (6 blocks, 1 colors)', 'C64': 'torch (17 blocks, 2 colors)', 'C65': 'superhero (15 blocks, 3 colors)', 'C66': 'connected_triangles (30 blocks, 3 colors)', 'C67': 'storm-cloud (25 blocks, 2 colors)', 'C68': 'christmas-tree (25 blocks, 6 colors)', 'C69': 'pickup_truck (38 blocks, 5 colors)', 'C7': 'scissors (23 blocks, 2 colors)', 'C70': 'random_snake (29 blocks, 2 colors)', 'C71': 'connected_rows_with_missing_blocks (15 blocks, 4 colors)', 'C72': 'cat (37 blocks, 4 colors)', 'C73': 'x_equals_y (18 blocks, 3 colors)', 'C74': 'random_objects (14 blocks, 4 colors)', 'C75': 'creative-five (11 blocks, 6 colors)', 'C76': 'double_tripod (16 blocks, 5 colors)', 'C77': '3d-maze (40 blocks, 5 colors)', 'C78': 'random_objects_2 (24 blocks, 3 colors)', 'C79': 'connected_crosses (25 blocks, 4 colors)', 'C8': 'table2 (12 blocks, 2 colors)', 'C80': 'lunging-man (18 blocks, 4 colors)', 'C81': 'cube-x (17 blocks, 3 colors)', 'C82': 'eiffel-tower (40 blocks, 4 colors)', 'C83': 'pyramid-table (33 blocks, 4 colors)', 'C84': 'trident (13 blocks, 2 colors)', 'C85': 'upvote (9 blocks, 2 colors)', 'C86': 'butterfly (24 blocks, 3 colors)', 'C87': 'sickles (10 blocks, 1 colors)', 'C88': 'sun_and_birds (19 blocks, 2 colors)', 'C89': 'm-and-m (23 blocks, 2 colors)', 'C9': 'asterisk (33 blocks, 2 colors)', 'C90': 'wind-farm (30 blocks, 4 colors)', 'C91': 'castle (41 blocks, 5 colors)', 'C92': 'cherries (16 blocks, 2 colors)', 'C93': 'L-back-to-back (8 blocks, 2 colors)', 'C94': 'disappearing-tunnel (35 blocks, 6 colors)', 'C95': 'chimney (26 blocks, 3 colors)', 'C96': 'four-corners (16 blocks, 4 colors)', 'C97': 'omega-u-corner (14 blocks, 2 colors)', 'C98': 'insects (24 blocks, 6 colors)', 'C99': 'keys (35 blocks, 2 colors)'}
- sample()
- set_task(task_id)
- static subset(task_set)
Module contents
- class iglu.tasks.CustomTasks(goals: List[Tuple[str, numpy.ndarray]])
Bases:
iglu.tasks.task_set.TaskSet
TaskSet that consists of user-defined goal structures
- Parameters
goals (List[Tuple[str, np.ndarray]]) – list of tasks. Each task is represented by a pair (string conversation, 3d numpy grid)
- class iglu.tasks.RandomTasks(max_blocks=4, height_levels=1, allow_float=False, max_dist=2, num_colors=1, max_cache=0)
Bases:
iglu.tasks.task_set.TaskSet
TaskSet that consists of number of randomly generated tasks
- Parameters
max_blocks (
int
) – The maximal number of blocks in each task. Defaults to 3.height_levels (
int
) – How many height levels random blocks can occupy. Defaults to 1.allow_float (
bool
) – Whether to allow blocks to have the air below. Defaults to False.max_dist (
int
) – Maximum (Chebyshev) distance between two blocks. Defaults to 2.num_colors (
int
) – Maximum number of unique colors. Defaults to 1.max_cache (
int
) – If zero, each .sample_task will generate new task. Otherwise, the number of random tasks to cache. Defaults to 0.
- dump(path)
- load(path)
- sample()
- sample_task()
- set_task(task_id)
- class iglu.tasks.TaskSet(preset='simplest', task_id=None, update_task_dict=False)
Bases:
object
- ALL = {'C1': 'bell (29 blocks, 5 colors)', 'C10': 'concentric_semicircles (21 blocks, 3 colors)', 'C100': 'wannabe_olympic_rings (42 blocks, 4 colors)', 'C101': 'connected_tunnels (31 blocks, 3 colors)', 'C102': 'man_on_broom (16 blocks, 4 colors)', 'C103': 'rotating_chair (19 blocks, 1 colors)', 'C104': 'clothesline (36 blocks, 2 colors)', 'C105': 'lol_ethylene (34 blocks, 3 colors)', 'C106': 'minimal_tree (18 blocks, 2 colors)', 'C107': 'colorful_alien (20 blocks, 3 colors)', 'C108': 'illinois-i (29 blocks, 2 colors)', 'C109': 'waving-flag (11 blocks, 2 colors)', 'C11': 'broken_heart (21 blocks, 2 colors)', 'C110': 'color-loop (16 blocks, 4 colors)', 'C111': 'color-cube (16 blocks, 4 colors)', 'C112': 'color-spiral (33 blocks, 5 colors)', 'C113': 'numbers (43 blocks, 4 colors)', 'C114': 'e3 (18 blocks, 2 colors)', 'C115': 'hollow_stools (23 blocks, 4 colors)', 'C116': 'diagonal_arch_and_triangle (17 blocks, 4 colors)', 'C117': 'pyramid_with_horns (20 blocks, 4 colors)', 'C118': 'random_objects_3 (12 blocks, 2 colors)', 'C119': 'funny_chair (38 blocks, 3 colors)', 'C12': 'diagonal-Ls (18 blocks, 6 colors)', 'C120': 'h_1_plus (14 blocks, 2 colors)', 'C121': '2d_giraffe (19 blocks, 3 colors)', 'C122': 'funny_bird (25 blocks, 4 colors)', 'C123': 'footballer (26 blocks, 3 colors)', 'C124': 'connected_triangles_2 (29 blocks, 3 colors)', 'C125': 'fail_hourglass (22 blocks, 3 colors)', 'C126': 'teapot (20 blocks, 2 colors)', 'C127': 'backpack (26 blocks, 3 colors)', 'C128': 'weird_chain (16 blocks, 4 colors)', 'C129': 'rhombuses_with_ring (34 blocks, 3 colors)', 'C13': 'eye (29 blocks, 3 colors)', 'C130': 'differently_oriented_squares (24 blocks, 2 colors)', 'C131': 'table_with_objects (35 blocks, 6 colors)', 'C132': 'diagonal_slab_with_pattern (20 blocks, 2 colors)', 'C133': 'adjacent_gates (28 blocks, 3 colors)', 'C134': 'parachute (28 blocks, 6 colors)', 'C135': 'bent-arrow (11 blocks, 1 colors)', 'C136': 'waving-man (17 blocks, 4 colors)', 'C137': 'no-u-turn (39 blocks, 2 colors)', 'C138': 'color-Us (42 blocks, 6 colors)', 'C139': 'minimalistic-mouse (16 blocks, 3 colors)', 'C14': 'diagonal-zigzag (16 blocks, 3 colors)', 'C140': 'weird-rows (28 blocks, 4 colors)', 'C141': 'dancing-banana (19 blocks, 4 colors)', 'C142': 'potted-weeds (28 blocks, 3 colors)', 'C143': 'drooping-flower (21 blocks, 5 colors)', 'C144': 'curly-R (20 blocks, 3 colors)', 'C145': 'pulse (19 blocks, 1 colors)', 'C146': 'boxy-to-diagonal (17 blocks, 5 colors)', 'C147': 'pi (26 blocks, 4 colors)', 'C148': 'headphones (40 blocks, 4 colors)', 'C149': 'drink-with-umbrella (37 blocks, 4 colors)', 'C15': 'double_stairs (36 blocks, 4 colors)', 'C150': 'checkerboard (16 blocks, 6 colors)', 'C151': 'hanger (16 blocks, 3 colors)', 'C152': 'ballerina (24 blocks, 3 colors)', 'C153': 'cursive-ok (27 blocks, 2 colors)', 'C154': 'gateway-to-stairs (52 blocks, 6 colors)', 'C155': 'sickles-difficult (24 blocks, 2 colors)', 'C156': 'sun_and_birds-difficult (19 blocks, 2 colors)', 'C157': 'butterfly-difficult (24 blocks, 3 colors)', 'C16': 'bloody-sword (24 blocks, 4 colors)', 'C17': 'orange-flat-original-L (3 blocks, 1 colors)', 'C18': 'overlapping-reticles (12 blocks, 3 colors)', 'C19': 'slide_with_arch (48 blocks, 3 colors)', 'C2': 'black-hole (20 blocks, 2 colors)', 'C20': 'rainbow-lasso (9 blocks, 6 colors)', 'C21': 'spectacles (29 blocks, 2 colors)', 'C22': 'smiley (6 blocks, 5 colors)', 'C23': 'suspension_bridge (68 blocks, 4 colors)', 'C24': 'cup (46 blocks, 4 colors)', 'C25': 'music-notes (18 blocks, 2 colors)', 'C26': 'rainbow-diagonal-stack (15 blocks, 6 colors)', 'C27': 'funny-Ts (25 blocks, 4 colors)', 'C28': 'duck (21 blocks, 2 colors)', 'C29': 'tetris (20 blocks, 5 colors)', 'C3': 'blue-original-L (3 blocks, 1 colors)', 'C30': '3d-triangle (20 blocks, 6 colors)', 'C31': 'hot (20 blocks, 3 colors)', 'C32': 'bigger-original-L (5 blocks, 1 colors)', 'C33': 'connected_diamonds_with_missing_blocks (14 blocks, 2 colors)', 'C34': 'complex_five (13 blocks, 3 colors)', 'C35': 'strange-triangles (20 blocks, 6 colors)', 'C36': 'street_lamps (31 blocks, 3 colors)', 'C37': 'embedded_fives (56 blocks, 6 colors)', 'C38': 'l-shape', 'C39': 'three-squares (24 blocks, 3 colors)', 'C4': 'flower_new (17 blocks, 4 colors)', 'C40': 'cross-stack (9 blocks, 6 colors)', 'C41': 'multiple_concepts (19 blocks, 3 colors)', 'C42': 'rubiks (18 blocks, 4 colors)', 'C43': 'girl_with_frock (29 blocks, 3 colors)', 'C44': 'hollow_diseased_rectangle (19 blocks, 4 colors)', 'C45': 'u-3 (14 blocks, 2 colors)', 'C46': 'wtf (11 blocks, 6 colors)', 'C47': 'staircase (18 blocks, 3 colors)', 'C48': 'umbrella (37 blocks, 4 colors)', 'C49': 'letter-cube (36 blocks, 4 colors)', 'C5': 'overlapping-chain-links (20 blocks, 2 colors)', 'C50': '3d-x_s (15 blocks, 3 colors)', 'C51': 'interlocking-magnets (16 blocks, 4 colors)', 'C52': 'hut_and_trees (31 blocks, 3 colors)', 'C53': 'funny-cube (20 blocks, 4 colors)', 'C54': '3d-diagonals (10 blocks, 3 colors)', 'C55': 'chains (19 blocks, 3 colors)', 'C56': 'color-wheel (25 blocks, 4 colors)', 'C57': 'four-three (17 blocks, 2 colors)', 'C58': 'ducks_in_pool (24 blocks, 2 colors)', 'C59': 'parallel-bars (20 blocks, 4 colors)', 'C6': 'rectangle-chain (40 blocks, 4 colors)', 'C60': 'diagonal-2 (20 blocks, 6 colors)', 'C61': 'chair2 (19 blocks, 2 colors)', 'C62': 'chair3 (32 blocks, 3 colors)', 'C63': 'question (6 blocks, 1 colors)', 'C64': 'torch (17 blocks, 2 colors)', 'C65': 'superhero (15 blocks, 3 colors)', 'C66': 'connected_triangles (30 blocks, 3 colors)', 'C67': 'storm-cloud (25 blocks, 2 colors)', 'C68': 'christmas-tree (25 blocks, 6 colors)', 'C69': 'pickup_truck (38 blocks, 5 colors)', 'C7': 'scissors (23 blocks, 2 colors)', 'C70': 'random_snake (29 blocks, 2 colors)', 'C71': 'connected_rows_with_missing_blocks (15 blocks, 4 colors)', 'C72': 'cat (37 blocks, 4 colors)', 'C73': 'x_equals_y (18 blocks, 3 colors)', 'C74': 'random_objects (14 blocks, 4 colors)', 'C75': 'creative-five (11 blocks, 6 colors)', 'C76': 'double_tripod (16 blocks, 5 colors)', 'C77': '3d-maze (40 blocks, 5 colors)', 'C78': 'random_objects_2 (24 blocks, 3 colors)', 'C79': 'connected_crosses (25 blocks, 4 colors)', 'C8': 'table2 (12 blocks, 2 colors)', 'C80': 'lunging-man (18 blocks, 4 colors)', 'C81': 'cube-x (17 blocks, 3 colors)', 'C82': 'eiffel-tower (40 blocks, 4 colors)', 'C83': 'pyramid-table (33 blocks, 4 colors)', 'C84': 'trident (13 blocks, 2 colors)', 'C85': 'upvote (9 blocks, 2 colors)', 'C86': 'butterfly (24 blocks, 3 colors)', 'C87': 'sickles (10 blocks, 1 colors)', 'C88': 'sun_and_birds (19 blocks, 2 colors)', 'C89': 'm-and-m (23 blocks, 2 colors)', 'C9': 'asterisk (33 blocks, 2 colors)', 'C90': 'wind-farm (30 blocks, 4 colors)', 'C91': 'castle (41 blocks, 5 colors)', 'C92': 'cherries (16 blocks, 2 colors)', 'C93': 'L-back-to-back (8 blocks, 2 colors)', 'C94': 'disappearing-tunnel (35 blocks, 6 colors)', 'C95': 'chimney (26 blocks, 3 colors)', 'C96': 'four-corners (16 blocks, 4 colors)', 'C97': 'omega-u-corner (14 blocks, 2 colors)', 'C98': 'insects (24 blocks, 6 colors)', 'C99': 'keys (35 blocks, 2 colors)'}
- sample()
- set_task(task_id)
- static subset(task_set)