alpaca/alpacka/agents/stochastic_mcts_test.py
def rate_new_leaves_tabular(
    leaf, observation, model, discount, state_values
):
    """Rates new leaves based on hardcoded values."""
    del leaf
    del observation
    del discount
    init_state = model.clone_state()

    def rating(action):
        (observation, reward, _, _) = model.step(action)
        model.restore_state(init_state)
        # State is the same as observation.
        return (reward, state_values[observation])

    return [rating(action) for action in range(model.action_space.n)]
Rates new leaves based on hardcoded values.
Rates new leaves based on hardcoded values.
Rates new leaves based on hardcoded values .
def rate_new_leaves_tabular(
    leaf, observation, model, discount, state_values
):
    del leaf
    del observation
    del discount
    init_state = model.clone_state()
    def rating(action):
        (observation, reward, _, _) = model.step(action)
        model.restore_state(init_state)
        return (reward, state_values[observation])
    return [rating(action) for action in range(model.action_space.n)]
def rate_new_leaves_tabular ( leaf , observation , model , discount , state_values ) : del leaf del observation del discount init_state = model . clone_state ( ) def rating ( action ) : ( observation , reward , _ , _ ) = model . step ( action ) model . restore_state ( init_state ) return ( reward , state_values [ observation ] ) return [ rating ( action ) for action in range ( model . action_space . n ) ]
Rates new leaves based on hardcoded values.
Rates new leaves based on hardcoded values .
"""Rates new leaves based on hardcoded values.""" # State is the same as observation.
leaf
observation
model
discount
state_values