basic_utils/layers.py
def mujoco_layer_designer(ob_space, ac_space):
    """
    Design the network structure for the mujoco games.

    Args:
        ob_space: the observation space
        ac_space: the action space

    Return:
        net_topology_pol_vec: structure of the policy network
        lr_updater: learning rate for the policy network
        net_topology_v_vec: structure of the value network
        lr_optimizer: learning rate for the value network
    """
    assert len(ob_space.shape) == 1

    hid1_size = ac_space.shape[0] * 10
    hid3_size = ob_space.shape[0] * 10
    hid2_size = int(np.sqrt(hid1_size*hid3_size))
    net_topology_pol_vec = [
        {'kind': 'dense', 'units': hid1_size},
        {'kind': 'Tanh'},
        {'kind': 'dense', 'units': hid2_size},
        {'kind': 'Tanh'},
        {'kind': 'dense', 'units': hid3_size},
        {'kind': 'Tanh'},
    ]
    net_topology_pol_vec = net_topology_pol_vec
    lr_updater = 9e-4 / np.sqrt(hid2_size)

    hid1_size = ac_space.shape[0] * 10
    hid3_size = 5
    hid2_size = int(np.sqrt(hid1_size * hid3_size))
    net_topology_v_vec = [
        {'kind': 'dense', 'units': hid1_size},
        {'kind': 'Tanh'},
        {'kind': 'dense', 'units': hid2_size},
        {'kind': 'Tanh'},
        {'kind': 'dense', 'units': hid3_size},
        {'kind': 'Tanh'},
    ]
    net_topology_v_vec = net_topology_v_vec
    lr_optimizer = 1e-2 / np.sqrt(hid2_size)

    return net_topology_pol_vec, lr_updater, net_topology_v_vec, lr_optimizer

    Design the network structure for the mujoco games.

    Args:
        ob_space: the observation space
        ac_space: the action space

    Return:
        net_topology_pol_vec: structure of the policy network
        lr_updater: learning rate for the policy network
        net_topology_v_vec: structure of the value network
        lr_optimizer: learning rate for the value network
    
Design the network structure for the mujoco games.
Design the network structure for the mujoco games .
def mujoco_layer_designer(ob_space, ac_space):
    assert len(ob_space.shape) == 1
    hid1_size = ac_space.shape[0] * 10
    hid3_size = ob_space.shape[0] * 10
    hid2_size = int(np.sqrt(hid1_size*hid3_size))
    net_topology_pol_vec = [
        {'kind': 'dense', 'units': hid1_size},
        {'kind': 'Tanh'},
        {'kind': 'dense', 'units': hid2_size},
        {'kind': 'Tanh'},
        {'kind': 'dense', 'units': hid3_size},
        {'kind': 'Tanh'},
    ]
    net_topology_pol_vec = net_topology_pol_vec
    lr_updater = 9e-4 / np.sqrt(hid2_size)
    hid1_size = ac_space.shape[0] * 10
    hid3_size = 5
    hid2_size = int(np.sqrt(hid1_size * hid3_size))
    net_topology_v_vec = [
        {'kind': 'dense', 'units': hid1_size},
        {'kind': 'Tanh'},
        {'kind': 'dense', 'units': hid2_size},
        {'kind': 'Tanh'},
        {'kind': 'dense', 'units': hid3_size},
        {'kind': 'Tanh'},
    ]
    net_topology_v_vec = net_topology_v_vec
    lr_optimizer = 1e-2 / np.sqrt(hid2_size)
    return net_topology_pol_vec, lr_updater, net_topology_v_vec, lr_optimizer
def mujoco_layer_designer ( ob_space , ac_space ) : assert len ( ob_space . shape ) == 1 hid1_size = ac_space . shape [ 0 ] * 10 hid3_size = ob_space . shape [ 0 ] * 10 hid2_size = int ( np . sqrt ( hid1_size * hid3_size ) ) net_topology_pol_vec = [ { 'kind' : 'dense' , 'units' : hid1_size } , { 'kind' : 'Tanh' } , { 'kind' : 'dense' , 'units' : hid2_size } , { 'kind' : 'Tanh' } , { 'kind' : 'dense' , 'units' : hid3_size } , { 'kind' : 'Tanh' } , ] net_topology_pol_vec = net_topology_pol_vec lr_updater = 9e-4 / np . sqrt ( hid2_size ) hid1_size = ac_space . shape [ 0 ] * 10 hid3_size = 5 hid2_size = int ( np . sqrt ( hid1_size * hid3_size ) ) net_topology_v_vec = [ { 'kind' : 'dense' , 'units' : hid1_size } , { 'kind' : 'Tanh' } , { 'kind' : 'dense' , 'units' : hid2_size } , { 'kind' : 'Tanh' } , { 'kind' : 'dense' , 'units' : hid3_size } , { 'kind' : 'Tanh' } , ] net_topology_v_vec = net_topology_v_vec lr_optimizer = 1e-2 / np . sqrt ( hid2_size ) return net_topology_pol_vec , lr_updater , net_topology_v_vec , lr_optimizer
Design the network structure for the mujoco games.
Design the network structure for the mujoco games .
"""
    Design the network structure for the mujoco games.

    Args:
        ob_space: the observation space
        ac_space: the action space

    Return:
        net_topology_pol_vec: structure of the policy network
        lr_updater: learning rate for the policy network
        net_topology_v_vec: structure of the value network
        lr_optimizer: learning rate for the value network
    """
ob_space
the observation space
the observation space
ac_space
the action space
the action space