Skip to content

Commit

Permalink
Renamed benchmark players to DipNetSLPlayer and DipNetRLPlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
ppaquette committed Sep 4, 2019
1 parent 2a16758 commit 16e0c92
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ $ python diplomacy_research/models/policy/order_based/train.py --model_id 12

### Playing against the SL and RL agents

It is possible to play against the published results by using the `NeurIPS2019SLPlayer` and `NeurIPS2019RLPlayer` players in `diplomacy_research.players.benchmark_player`.
It is possible to play against the published results by using the `DipNetSLPlayer` and `DipNetRLPlayer` players in `diplomacy_research.players.benchmark_player`.

These players will automatically download a singularity container with the trained weights, and then launch a TF serving server to handle the requests.

Expand All @@ -101,13 +101,13 @@ from tornado import gen
import ujson as json
from diplomacy import Game
from diplomacy.utils.export import to_saved_game_format
from diplomacy_research.players.benchmark_player import NeurIPS2019SLPlayer
from diplomacy_research.players.benchmark_player import DipNetSLPlayer
from diplomacy_research.utils.cluster import start_io_loop, stop_io_loop

@gen.coroutine
def main():
""" Plays a local game with 7 bots """
player = NeurIPS2019SLPlayer()
player = DipNetSLPlayer()
game = Game()

# Playing game
Expand Down
24 changes: 12 additions & 12 deletions diplomacy_research/players/benchmark_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
MAX_TIME_BETWEEN_CHECKS = 300


class NeurIPS2019SLPlayer(ModelBasedPlayer):
""" NeurIPS 2019 Supervised Learning Benchmark Player """
class DipNetSLPlayer(ModelBasedPlayer):
""" DipNet SL - NeurIPS 2019 Supervised Learning Benchmark Player """

def __init__(self, temperature=0.1, use_beam=False, port=9501, name=None):
""" Constructor
Expand All @@ -61,13 +61,13 @@ def __init__(self, temperature=0.1, use_beam=False, port=9501, name=None):
policy_adapter = sl_neurips2019.PolicyAdapter(grpc_dataset)

# Building benchmark model
super(NeurIPS2019SLPlayer, self).__init__(policy_adapter=policy_adapter,
temperature=temperature,
use_beam=use_beam,
name=name)
super(DipNetSLPlayer, self).__init__(policy_adapter=policy_adapter,
temperature=temperature,
use_beam=use_beam,
name=name)

class NeurIPS2019RLPlayer(ModelBasedPlayer):
""" NeurIPS 2019 Reinforcement Learning Benchmark Player """
class DipNetRLPlayer(ModelBasedPlayer):
""" DipNet RL - NeurIPS 2019 Reinforcement Learning Benchmark Player """

def __init__(self, temperature=0.1, use_beam=False, port=9502, name=None):
""" Constructor
Expand All @@ -91,10 +91,10 @@ def __init__(self, temperature=0.1, use_beam=False, port=9502, name=None):
policy_adapter = rl_neurips2019.PolicyAdapter(grpc_dataset)

# Building benchmark model
super(NeurIPS2019RLPlayer, self).__init__(policy_adapter=policy_adapter,
temperature=temperature,
use_beam=use_beam,
name=name)
super(DipNetRLPlayer, self).__init__(policy_adapter=policy_adapter,
temperature=temperature,
use_beam=use_beam,
name=name)

class WebDiplomacyPlayer(ModelBasedPlayer):
""" WebDiplomacy Player """
Expand Down
4 changes: 2 additions & 2 deletions diplomacy_research/scripts/launch_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from diplomacy import connect
from diplomacy.utils import constants, exceptions, strings
from tornado import gen, ioloop
from diplomacy_research.players.benchmark_player import NeurIPS2019SLPlayer
from diplomacy_research.players.benchmark_player import DipNetSLPlayer

LOGGER = logging.getLogger('diplomacy_research.scripts.launch_bot')
PERIOD_SECONDS = 2
Expand Down Expand Up @@ -66,7 +66,7 @@ def run(self):
""" Main bot code. """

# Creating player
self.player = NeurIPS2019SLPlayer()
self.player = DipNetSLPlayer()

# Connecting to server
connection = yield connect(self.host, self.port)
Expand Down

0 comments on commit 16e0c92

Please sign in to comment.