MCPcopy Create free account

hub / github.com/Vincentzyx/Douzero_Resnet / functions

Functions168 in github.com/Vincentzyx/Douzero_Resnet

↓ 64 callersFunction_cards2array
A utility function that transforms the actions, i.e., A list of integers into card matrix. Here we remove the six entries that are always
douzero/env/env.py:419
↓ 20 callersFunction_get_one_hot_array
A utility function to obtain one-hot endoding
douzero/env/env.py:408
↓ 11 callersMethodeval
(self)
douzero/dmc/models.py:458
↓ 8 callersMethod__init__
(self, device=0)
douzero/dmc/models.py:438
↓ 8 callersFunction_action_seq_list2array
A utility function to encode the historical moves. We encode the historical 15 actions. If there is no 15 actions, we pad the features wi
douzero/env/env.py:458
↓ 8 callersFunction_get_one_hot_bomb
A utility function to encode the number of bombs into one-hot representation.
douzero/env/env.py:506
↓ 8 callersFunction_process_action_seq
A utility function encoding historical moves. We encode 15 moves. If there is no 15 moves, we pad with zeros.
douzero/env/env.py:490
↓ 8 callersMethodshare_memory
(self)
douzero/dmc/models.py:452
↓ 7 callersFunctioncommon_handle
(moves, rival_move)
douzero/env/move_selector.py:4
↓ 7 callersMethodforward
(self, position, z, x, training=False, flags=None, debug=False)
douzero/dmc/models.py:448
↓ 6 callersMethodget_model
(self, position)
douzero/dmc/models.py:467
↓ 6 callersFunctionis_continuous_seq
(move)
douzero/env/move_detector.py:5
↓ 4 callersMethodgen_type_10_serial_triple
(self, repeat_num=0)
douzero/env/move_generator.py:134
↓ 4 callersMethodgen_type_4_bomb
(self)
douzero/env/move_generator.py:94
↓ 4 callersMethodgen_type_5_king_bomb
(self)
douzero/env/move_generator.py:101
↓ 4 callersFunctionget_obs
This function obtains observations with imperfect information from the infoset. It has three branches since we encode different features
douzero/env/env.py:369
↓ 4 callersMethodparameters
(self, position)
douzero/dmc/models.py:464
↓ 4 callersFunctionselect
(cards, num)
douzero/env/utils.py:32
↓ 3 callersMethod_gen_serial_moves
(self, cards, min_serial, repeat=1, repeat_num=0)
douzero/env/move_generator.py:27
↓ 3 callersMethod_get_reward
This function is called in the end of each game. It returns either 1/-1 for win/loss, or ADP, i.e., every bomb will double th
douzero/env/env.py:261
↓ 3 callersMethod_get_reward_bidding
This function is called in the end of each game. It returns either 1/-1 for win/loss, or ADP, i.e., every bomb will double th
douzero/env/env.py:285
↓ 3 callersMethod_make_layer
(self, block, planes, num_blocks, stride)
douzero/dmc/models.py:271
↓ 3 callersMethodcard_play_init
(self, card_play_data)
douzero/env/game.py:73
↓ 3 callersMethodgen_type_1_single
(self)
douzero/env/move_generator.py:74
↓ 3 callersMethodgen_type_2_pair
(self)
douzero/env/move_generator.py:80
↓ 3 callersMethodgen_type_3_triple
(self)
douzero/env/move_generator.py:87
↓ 2 callersMethod__init__
(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0, degenerated_to_sgd=False)
douzero/radam/radam.py:7
↓ 2 callersMethod__setstate__
(self, state)
douzero/radam/radam.py:25
↓ 2 callersFunction_format_observation
A utility function to process observations and move them to CUDA.
douzero/dmc/env_utils.py:9
↓ 2 callersFunction_get_obs_for_bid
(player_id, bid_info, hand_cards)
douzero/env/env.py:1275
↓ 2 callersMethod_save_metadata
(self)
douzero/dmc/file_writer.py:185
↓ 2 callersFunctioncheckpoint
(frames)
douzero/dmc/dmc.py:181
↓ 2 callersFunctiongen_bid_legal_actions
(player_id, bid_info)
douzero/env/env.py:1141
↓ 2 callersMethodgen_type_11_serial_3_1
(self, repeat_num=0)
douzero/env/move_generator.py:142
↓ 2 callersMethodgen_type_12_serial_3_2
(self, repeat_num=0)
douzero/env/move_generator.py:158
↓ 2 callersMethodgen_type_13_4_2
(self)
douzero/env/move_generator.py:174
↓ 2 callersMethodgen_type_14_4_22
(self)
douzero/env/move_generator.py:188
↓ 2 callersMethodgen_type_6_3_1
(self)
douzero/env/move_generator.py:107
↓ 2 callersMethodgen_type_7_3_2
(self)
douzero/env/move_generator.py:115
↓ 2 callersMethodgen_type_8_serial_single
(self, repeat_num=0)
douzero/env/move_generator.py:123
↓ 2 callersMethodgen_type_9_serial_pair
(self, repeat_num=0)
douzero/env/move_generator.py:126
↓ 2 callersMethodget_acting_player_position
(self)
douzero/env/game.py:173
↓ 2 callersMethodget_infoset
(self)
douzero/env/game.py:325
↓ 2 callersFunctionpick_chain
(hand_list, count)
douzero/evaluation/rlcard_agent.py:106
↓ 2 callersMethodreset
Every time reset is called, the environment will be re-initialized with a new deck of cards. This function is usually called
douzero/env/env.py:58
↓ 2 callersMethodstep
(self, action, model, device, flags=None)
douzero/dmc/env_utils.py:58
↓ 1 callersFunctionEnvToOnehot
(cards)
BidModel.py:11
↓ 1 callersFunctionRealToOnehot
(cards)
BidModel.py:19
↓ 1 callersFunction_cards2tensor
Convert a list of integers to the tensor representation See Figure 2 in https://arxiv.org/pdf/2106.06135.pdf
douzero/dmc/utils.py:178
↓ 1 callersFunction_get_obs_general
(infoset, position)
douzero/env/env.py:1017
↓ 1 callersFunction_get_obs_landlord
Obttain the landlord features. See Table 4 in https://arxiv.org/pdf/2106.06135.pdf
douzero/env/env.py:516
↓ 1 callersFunction_get_obs_landlord_down
Obttain the landlord_down features. See Table 5 in https://arxiv.org/pdf/2106.06135.pdf
douzero/env/env.py:698
↓ 1 callersFunction_get_obs_landlord_up
Obttain the landlord_up features. See Table 5 in https://arxiv.org/pdf/2106.06135.pdf
douzero/env/env.py:600
↓ 1 callersFunction_load_model
(position, model_path, model_type)
douzero/evaluation/deep_agent.py:6
↓ 1 callersMethodact
Simply return the action that is set previously.
douzero/env/env.py:354
↓ 1 callersFunctioncard_str2list
(hand)
douzero/evaluation/rlcard_agent.py:93
↓ 1 callersMethodclose
(self, successful: bool = True)
douzero/dmc/file_writer.py:179
↓ 1 callersFunctioncombine_cards
Get optimal combinations of cards in hand
douzero/evaluation/rlcard_agent.py:129
↓ 1 callersFunctioncompute_loss
(logits, targets)
douzero/dmc/dmc.py:22
↓ 1 callersMethodcompute_player_utility
(self)
douzero/env/game.py:96
↓ 1 callersFunctioncreate_env
(flags)
douzero/dmc/utils.py:39
↓ 1 callersFunctioncreate_optimizers
Create three optimizers for the three positions
douzero/dmc/utils.py:59
↓ 1 callersFunctiondata_allocation_per_worker
(card_play_data_list, num_workers)
douzero/evaluation/simulation.py:111
↓ 1 callersFunctionevaluate
(landlord, landlord_up, landlord_down, eval_data, num_workers, output, output_bid, title)
douzero/evaluation/simulation.py:118
↓ 1 callersMethodgame_done
(self)
douzero/env/game.py:85
↓ 1 callersMethodgen_moves
(self)
douzero/env/move_generator.py:203
↓ 1 callersFunctiongenerate
()
generate_eval_data.py:17
↓ 1 callersFunctionget_batch
This function will sample a batch from the buffers based on the indices received from the full queue. It will also free the indices by se
douzero/dmc/utils.py:42
↓ 1 callersMethodget_bomb_num
(self)
douzero/env/game.py:118
↓ 1 callersMethodget_last_move
(self)
douzero/env/game.py:156
↓ 1 callersMethodget_last_two_moves
(self)
douzero/env/game.py:166
↓ 1 callersMethodget_legal_card_play_actions
(self)
douzero/env/game.py:196
↓ 1 callersMethodget_models
(self)
douzero/dmc/models.py:470
↓ 1 callersFunctionget_parser
()
generate_eval_data.py:11
↓ 1 callersMethodget_winner
(self)
douzero/env/game.py:115
↓ 1 callersMethodinitial
(self, model, device, flags=None)
douzero/dmc/env_utils.py:36
↓ 1 callersFunctionlearn
Performs a learning (optimization) step.
douzero/dmc/dmc.py:27
↓ 1 callersFunctionlist2card_str
(hand_list)
douzero/evaluation/rlcard_agent.py:99
↓ 1 callersFunctionload_card_play_models
(card_play_model_path_dict)
douzero/evaluation/simulation.py:10
↓ 1 callersMethodlog
(self, to_log: Dict, tick: int = None, verbose: bool = False)
douzero/dmc/file_writer.py:146
↓ 1 callersMethodreset
(self)
douzero/env/game.py:284
↓ 1 callersMethodset_action
The environment uses this function to tell the dummy agent what to do.
douzero/env/env.py:361
↓ 1 callersMethodstep
(self)
douzero/env/game.py:121
↓ 1 callersFunctiontrain
This is the main funtion for training. It will first initilize everything, such as buffers, optimizers, etc. Then it will start subproces
douzero/dmc/dmc.py:57
↓ 1 callersMethodupdate_acting_player_hand_cards
(self, action)
douzero/env/game.py:189
↓ 1 callersMethodupdate_num_wins_scores
(self)
douzero/env/game.py:105
Method__init__
(self)
BidModel.py:31
Method__init__
(self, cards_list)
douzero/env/move_generator.py:9
Method__init__
(self, players)
douzero/env/game.py:21
Method__init__
(self, player_position)
douzero/env/game.py:377
Method__init__
Objective is wp/adp/logadp. It indicates whether considers bomb in reward calculation. Here, we use dummy agents. This is bec
douzero/env/env.py:32
Method__init__
(self, position)
douzero/env/env.py:350
Method__init__
(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0, degenerated_to_sgd=False)
douzero/radam/radam.py:98
Method__init__
(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0, warmup = 0)
douzero/radam/radam.py:175
Method__init__
(self, position, model_path)
douzero/evaluation/deep_agent.py:29
Method__init__
(self)
douzero/evaluation/random_agent.py:5
Method__init__
(self, position)
douzero/evaluation/rlcard_agent.py:18
Method__init__
(self, xpid: str = None, xp_args: dict = None, rootdir: str
douzero/dmc/file_writer.py:62
Method__init__
Initialzie this environment wrapper
douzero/dmc/env_utils.py:29
Method__init__
(self)
douzero/dmc/models.py:13
next →1–100 of 168, ranked by callers