ailiga.trained_fighter.TrainedFighter

class ailiga.trained_fighter.TrainedFighter(lambda_env)[source]

Bases: Fighter

A trained fighter.

__init__(lambda_env)

Methods

__init__(lambda_env)

assert_env([name])

Assert that the env is compatible with the fighter.

compatible_envs()

Return a list of compatible envs.

get_default_savefile()

Get the default savefile name.

get_env_name()

Get the name of the env.

get_logger()

get_name()

Get the name of the fighter.

get_policy()

Get the policy.

get_user()

Get the user name.

load([savefile])

Load the policy from a file.

reset()

Reset the policy and the environment.

reward_metric(rews)

Pick the reward of the agent we are training.

save([policy, savefile])

Save the policy.

train([seed, reset])

train_all()

valid_env(name)

Attributes

agentindex

logdir

test_envs

test_num

train_envs

traindir

training_num

user

assert_env(name=None)

Assert that the env is compatible with the fighter.

classmethod compatible_envs()

Return a list of compatible envs.

get_default_savefile()[source]

Get the default savefile name.

get_env_name()

Get the name of the env.

Return type:

str

classmethod get_name()

Get the name of the fighter.

get_policy()

Get the policy.

classmethod get_user()

Get the user name.

load(savefile=None)[source]

Load the policy from a file.

reset()[source]

Reset the policy and the environment.

reward_metric(rews)[source]

Pick the reward of the agent we are training.

save(policy=None, savefile=None)[source]

Save the policy.