Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New v2 instances #11

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion codenames/in/generous_instances.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions codenames/in/generous_instances_v1_6.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion codenames/in/instances.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions codenames/in/instances_v1_6.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions codenames/instancegenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
GENEROUS_FILENAME = "generous_instances.json"
FLAGS = ["IGNORE RAMBLING", "IGNORE FALSE TARGETS OR GUESSES", "REPROMPT ON ERROR", "STRIP WORDS", "IGNORE NUMBER OF TARGETS"]

# SEED = 42 # seed for old/v1.6 instances
SEED = 123

def generate_random(wordlist, required):
# sample words for the board
total = required[TEAM] + required[OPPONENT] + required[INNOCENT] + required[ASSASSIN]
Expand Down
9 changes: 6 additions & 3 deletions guesswhat/instancegenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import sys
from pathlib import Path
import logging

print(f"Python executable: {sys.executable}")
print(f"Python path: {sys.path}")
Expand All @@ -16,18 +17,19 @@
import random
import json
from tqdm import tqdm
import clemgame
from clemgame.clemgame import GameInstanceGenerator
import clemcore.clemgame as clemgame
from clemcore.clemgame import GameInstanceGenerator

# number of words per episode
num_words = 8

# number of instances per experiment
N_INSTANCES = 10

logger = clemgame.get_logger(__name__)
logger = logging.getLogger(__name__)
GAME_NAME = "guesswhat"

SEED = 42

class GuessWhatGameInstanceGenerator(GameInstanceGenerator):
def __init__(self):
Expand Down Expand Up @@ -283,6 +285,7 @@ def save_json(self, data, filepath):
json.dump(data, f, indent=4)

if __name__ == '__main__':
random.seed(SEED)
GuessWhatGameInstanceGenerator().generate()


12 changes: 6 additions & 6 deletions guesswhat/master.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from typing import Dict, List
import numpy as np
from backends import Model
from clemgame.clemgame import GameMaster, GameBenchmark, Player, DialogueGameMaster, GameScorer
from clemgame.metrics import METRIC_ABORTED, METRIC_SUCCESS, METRIC_LOSE, METRIC_REQUEST_COUNT, \
import logging
from clemcore.backends import Model
from clemcore.clemgame import GameMaster, GameBenchmark, Player, DialogueGameMaster, GameScorer
from clemcore.clemgame.metrics import METRIC_ABORTED, METRIC_SUCCESS, METRIC_LOSE, METRIC_REQUEST_COUNT, \
METRIC_REQUEST_COUNT_VIOLATED, METRIC_REQUEST_COUNT_PARSED, METRIC_REQUEST_SUCCESS, BENCH_SCORE
from clemgame import get_logger
from clemgame import file_utils, string_utils
from clemcore.utils import file_utils, string_utils
import math
import re

GAME_NAME = "guesswhat"

logger = get_logger(__name__)
logger = logging.getLogger(__name__)


class Guesser(Player):
Expand Down
120 changes: 60 additions & 60 deletions matchit/in/instances_pentomino.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,62 +5,62 @@
"game_instances": [
{
"game_id": 0,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/1.jpg",
"decision_turn": 3
},
{
"game_id": 1,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/2.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/2.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/2.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/2.jpg",
"decision_turn": 3
},
{
"game_id": 2,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/3.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/3.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/3.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/3.jpg",
"decision_turn": 3
},
{
"game_id": 3,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/4.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/4.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/4.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/4.jpg",
"decision_turn": 3
},
{
"game_id": 4,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/5.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/5.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/5.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/5.jpg",
"decision_turn": 3
},
{
"game_id": 5,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/6.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/6.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/6.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/6.jpg",
"decision_turn": 3
},
{
"game_id": 6,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/7.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/7.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/7.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/7.jpg",
"decision_turn": 3
},
{
"game_id": 7,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/8.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/8.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/8.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/8.jpg",
"decision_turn": 3
},
{
"game_id": 8,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/9.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/9.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/9.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/9.jpg",
"decision_turn": 3
},
{
"game_id": 9,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/10.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/10.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/10.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/10.jpg",
"decision_turn": 3
}
],
Expand All @@ -83,62 +83,62 @@
"game_instances": [
{
"game_id": 0,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/2.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/2.jpg",
"decision_turn": 3
},
{
"game_id": 1,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/3.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/3.jpg",
"decision_turn": 3
},
{
"game_id": 2,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/2.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/3.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/2.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/3.jpg",
"decision_turn": 3
},
{
"game_id": 3,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/4.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/4.jpg",
"decision_turn": 3
},
{
"game_id": 4,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/5.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/5.jpg",
"decision_turn": 3
},
{
"game_id": 5,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/4.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/5.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/4.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/5.jpg",
"decision_turn": 3
},
{
"game_id": 6,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/6.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/6.jpg",
"decision_turn": 3
},
{
"game_id": 7,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/7.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/7.jpg",
"decision_turn": 3
},
{
"game_id": 8,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/6.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/7.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/6.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/7.jpg",
"decision_turn": 3
},
{
"game_id": 9,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/8.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/9.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/8.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/9.jpg",
"decision_turn": 3
}
],
Expand All @@ -161,62 +161,62 @@
"game_instances": [
{
"game_id": 0,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/8.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/1.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/8.jpg",
"decision_turn": 3
},
{
"game_id": 1,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/2.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/9.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/2.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/9.jpg",
"decision_turn": 3
},
{
"game_id": 2,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/3.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/10.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/3.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/10.jpg",
"decision_turn": 3
},
{
"game_id": 3,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/4.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/11.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/4.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/11.jpg",
"decision_turn": 3
},
{
"game_id": 4,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/5.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/12.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/5.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/12.jpg",
"decision_turn": 3
},
{
"game_id": 5,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/6.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/13.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/6.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/13.jpg",
"decision_turn": 3
},
{
"game_id": 6,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/7.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/14.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/7.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/14.jpg",
"decision_turn": 3
},
{
"game_id": 7,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/8.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/15.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/8.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/15.jpg",
"decision_turn": 3
},
{
"game_id": 8,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/9.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/16.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/9.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/16.jpg",
"decision_turn": 3
},
{
"game_id": 9,
"image_a": "games/multimodal_referencegame/resources/pentomino_images/10.jpg",
"image_b": "games/multimodal_referencegame/resources/pentomino_images/17.jpg",
"image_a": "../clemgames/multimodal_referencegame/resources/pentomino_images/10.jpg",
"image_b": "../clemgames/multimodal_referencegame/resources/pentomino_images/17.jpg",
"decision_turn": 3
}
],
Expand Down
Loading