From 8953f3d6433030017da4ce415964151e8885046f Mon Sep 17 00:00:00 2001 From: zhiyang7 Date: Fri, 31 Dec 2021 09:41:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=8D=E4=BD=8E=E6=B5=8B=E8=AF=95=E9=9B=86?= =?UTF-8?q?=E8=AF=AF=E5=B7=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- douzero/server/battle.py | 12 ++++++------ evaluate_server.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/douzero/server/battle.py b/douzero/server/battle.py index 0046b72..8222763 100644 --- a/douzero/server/battle.py +++ b/douzero/server/battle.py @@ -26,8 +26,8 @@ def init_battlefield(flags): pass def battle_logic(flags, baseline : Baseline, battle : Battle): - eval_data_first = 'eval_data_200.pkl' - eval_data_second = 'eval_data_800.pkl' + eval_data_first = 'eval_data_1000.pkl' + eval_data_second = 'eval_data_4000.pkl' challenger_baseline = { 'landlord_path': str(baseline.landlord_path), 'landlord_up_path': str(baseline.landlord_up_path), @@ -47,7 +47,7 @@ def battle_logic(flags, baseline : Baseline, battle : Battle): challenger_baseline['landlord_front_path'], challenger_baseline['landlord_down_path'], eval_data_first, - 3, + 2, False, 'New') def _second_eval(landlord_wp, farmer_wp, landlord_adp, farmer_adp): @@ -57,7 +57,7 @@ def battle_logic(flags, baseline : Baseline, battle : Battle): challenger_baseline['landlord_front_path'], challenger_baseline['landlord_down_path'], eval_data_second, - 3, + 2, False, 'New') return (landlord_wp + landlord_wp_2 * 4.0) / 5, \ @@ -69,13 +69,13 @@ def battle_logic(flags, baseline : Baseline, battle : Battle): update_threshold_landlord = 1 + flags.update_threshold update_threshold_farmer = 1 + flags.update_threshold / 3 if battle.challenger_position == 'landlord': - if baseline.landlord_wp == 0 or landlord_wp / float(baseline.landlord_wp) >= update_threshold_landlord: + if baseline.landlord_wp == 0 or landlord_wp / float(baseline.landlord_wp) > 1: landlord_wp, farmer_wp, landlord_adp, farmer_adp = \ _second_eval(landlord_wp, farmer_wp, landlord_adp, farmer_adp) if baseline.landlord_wp == 0 or landlord_wp / float(baseline.landlord_wp) >= update_threshold_landlord: challenge_success = True else: - if baseline.farmer_wp == 0 or farmer_wp / float(baseline.farmer_wp) >= update_threshold_farmer: + if baseline.farmer_wp == 0 or farmer_wp / float(baseline.farmer_wp) > 1: landlord_wp, farmer_wp, landlord_adp, farmer_adp = \ _second_eval(landlord_wp, farmer_wp, landlord_adp, farmer_adp) if baseline.farmer_wp == 0 or farmer_wp / float(baseline.farmer_wp) >= update_threshold_farmer: diff --git a/evaluate_server.py b/evaluate_server.py index 0c73cb2..708b79f 100644 --- a/evaluate_server.py +++ b/evaluate_server.py @@ -276,7 +276,7 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description='DouZero evaluation backend') parser.add_argument('--debug', action='store_true') parser.add_argument('--enable_task', type=bool) - parser.add_argument('--update_threshold', type=float, default=0.09) + parser.add_argument('--update_threshold', type=float, default=0.03) parser.add_argument('--db_host', type=str, default='127.0.0.1') parser.add_argument('--db_schema', type=str, default='dou_model') parser.add_argument('--db_user', type=str, default='douzero')