Open sakami0000 opened 1 year ago
src/agent.py
from handyrl.agent import RandomAgent from handyrl.evaluation import register_agent @register_agent(alias="transformer") class TransformerAgent(RandomAgent): def __init__(self, temperature=0.0): self.temperature = temperature def action(self, env, player, show=False): action = model_predict(env, player, temperature=self.temperature) return action
python main.py -e random:src.agent.TransformerAgent 100 8
python main.py -e random:src.agent.TransformerAgent,temperature=1.0 100 8
NOTE: The entire target value must be enclosed in another quotation marks because quotation marks are erased in python arguments.
python main.py -e random:'src.agent.TransformerAgent,hoge="hoge, fuga"' 100 8
handyrl.evaluation.register_agent
NOTE: The agent class must be defined in the current context.
main.py
import src.agent
python main.py -e random:transformer,temperature=0.5 100 8
opponent: [ 'src.agent.TransformerAgent,temperature=0.5', 'src.agent.TransformerAgent,temperature=0.5,hoge="hoge, fuga"' ]
opponent: [ 'src.agent.TransformerAgent, temperature=0.5', 'src.agent.TransformerAgent, temperature=0.5, hoge="hoge, fuga"' ]
src/agent.py
NOTE: The entire target value must be enclosed in another quotation marks because quotation marks are erased in python arguments.
handyrl.evaluation.register_agent
.NOTE: The agent class must be defined in the current context.
main.py