registry.py 1.6 KB
Newer Older
spmohanty's avatar
spmohanty committed
1
2
"""
Registry of custom implemented algorithms names
3
4
5
6
7
8
9
10
11
12

Please refer to the following examples to add your custom algorithms : 

- AlphaZero : https://github.com/ray-project/ray/tree/master/rllib/contrib/alpha_zero
- bandits : https://github.com/ray-project/ray/tree/master/rllib/contrib/bandits
- maddpg : https://github.com/ray-project/ray/tree/master/rllib/contrib/maddpg
- random_agent: https://github.com/ray-project/ray/tree/master/rllib/contrib/random_agent

An example integration of the random agent is shown here : 
- https://github.com/AIcrowd/neurips2020-procgen-starter-kit/tree/master/algorithms/custom_random_agent
spmohanty's avatar
spmohanty committed
13
14
"""

15

spmohanty's avatar
spmohanty committed
16
17
def _import_custom_random_agent():
    from .custom_random_agent.custom_random_agent import CustomRandomAgent
18
    return CustomRandomAgent
spmohanty's avatar
spmohanty committed
19

Jyotish's avatar
Jyotish committed
20
def _import_random_policy():
Jyotish's avatar
Jyotish committed
21
22
    from .random_policy.trainer import RandomPolicyTrainer
    return RandomPolicyTrainer
Jyotish's avatar
Jyotish committed
23

Dipam Chakraborty's avatar
Dipam Chakraborty committed
24
25
26
27
def _import_custom_ppo_agent():
    from .custom_ppo.ppo import PPOTrainer
    return PPOTrainer

Dipam Chakraborty's avatar
Dipam Chakraborty committed
28
29
30
31
def _import_custom_torch_agent():
    from .custom_torch_agent.ppo import PPOTrainer
    return PPOTrainer

Dipam Chakraborty's avatar
Dipam Chakraborty committed
32
33
34
35
def _import_custom_torch_ppg():
    from .custom_ppg.ppg import PPGTrainer
    return PPGTrainer

36
37
38
39
40
def _import_ppo_experimental():
    from .ppo_experimental.ppo import PPOTrainer
    return PPOTrainer


spmohanty's avatar
spmohanty committed
41
42

CUSTOM_ALGORITHMS = {
Jyotish's avatar
Jyotish committed
43
    "custom/CustomRandomAgent": _import_custom_random_agent,
Dipam Chakraborty's avatar
Dipam Chakraborty committed
44
    "RandomPolicy": _import_random_policy,
Dipam Chakraborty's avatar
Dipam Chakraborty committed
45
    "CustomPPOAgent": _import_custom_ppo_agent,
Dipam Chakraborty's avatar
Dipam Chakraborty committed
46
    "CustomTorchPPOAgent": _import_custom_torch_agent,
47
48
    "CustomTorchPPGAgent": _import_custom_torch_ppg,
    "PPOExperimental": _import_ppo_experimental,
49
}
50