降低测试集误差

This commit is contained in:
zhiyang7 2021-12-31 09:41:49 +08:00
parent 089f4d1481
commit 8953f3d643
2 changed files with 7 additions and 7 deletions

View File

@ -26,8 +26,8 @@ def init_battlefield(flags):
pass pass
def battle_logic(flags, baseline : Baseline, battle : Battle): def battle_logic(flags, baseline : Baseline, battle : Battle):
eval_data_first = 'eval_data_200.pkl' eval_data_first = 'eval_data_1000.pkl'
eval_data_second = 'eval_data_800.pkl' eval_data_second = 'eval_data_4000.pkl'
challenger_baseline = { challenger_baseline = {
'landlord_path': str(baseline.landlord_path), 'landlord_path': str(baseline.landlord_path),
'landlord_up_path': str(baseline.landlord_up_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_front_path'],
challenger_baseline['landlord_down_path'], challenger_baseline['landlord_down_path'],
eval_data_first, eval_data_first,
3, 2,
False, False,
'New') 'New')
def _second_eval(landlord_wp, farmer_wp, landlord_adp, farmer_adp): 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_front_path'],
challenger_baseline['landlord_down_path'], challenger_baseline['landlord_down_path'],
eval_data_second, eval_data_second,
3, 2,
False, False,
'New') 'New')
return (landlord_wp + landlord_wp_2 * 4.0) / 5, \ 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_landlord = 1 + flags.update_threshold
update_threshold_farmer = 1 + flags.update_threshold / 3 update_threshold_farmer = 1 + flags.update_threshold / 3
if battle.challenger_position == 'landlord': 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 = \ landlord_wp, farmer_wp, landlord_adp, farmer_adp = \
_second_eval(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: if baseline.landlord_wp == 0 or landlord_wp / float(baseline.landlord_wp) >= update_threshold_landlord:
challenge_success = True challenge_success = True
else: 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 = \ landlord_wp, farmer_wp, landlord_adp, farmer_adp = \
_second_eval(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: if baseline.farmer_wp == 0 or farmer_wp / float(baseline.farmer_wp) >= update_threshold_farmer:

View File

@ -276,7 +276,7 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(description='DouZero evaluation backend') parser = argparse.ArgumentParser(description='DouZero evaluation backend')
parser.add_argument('--debug', action='store_true') parser.add_argument('--debug', action='store_true')
parser.add_argument('--enable_task', type=bool) 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_host', type=str, default='127.0.0.1')
parser.add_argument('--db_schema', type=str, default='dou_model') parser.add_argument('--db_schema', type=str, default='dou_model')
parser.add_argument('--db_user', type=str, default='douzero') parser.add_argument('--db_user', type=str, default='douzero')