# update parameters
gamma = 0.99
tau = 0.001
hmm_state = 10

## ------------------------------

# define model
model = HNRN(max_buffer=MAX_BUFFER,
             state_dim=STATE_DIM,
             sensor_dim=SENSOR_DIM,
             target_dim=TARGET_DIM,
             action_dim=ACTION_DIM,
             mu=mu,
             theta=theta,
             sigma=sigma,
             gamma=gamma,
             tau=tau,
             train_type=TRAIN_TYPE,
             actor_lr=actor_lr,
             critic_lr=critic_lr,
             batch_size=batch_size,
             hmm_state=hmm_state)

# define ROS service client and messages
rospy.wait_for_service('/gazebo_env_io/pytorch_io_service')
pytorch_io_service = rospy.ServiceProxy('/gazebo_env_io/pytorch_io_service',
                                        SimpleCtrl)
TERMINAL_REWARD, COLLISION_REWARD, SURVIVE_REWARD = utils.get_parameters(
    '../../gazebo_drl_env/param/env.yaml')
示例#2
0
theta = 2
sigma = 0.2
# learning rate
actor_lr = 1e-4
critic_lr = 1e-3
batch_size = 256
# update parameters
gamma = 0.99
tau = 0.001
hmm_state = 10

## ------------------------------

# define model
model = HNRN(max_buffer=0, state_dim=STATE_DIM, sensor_dim=SENSOR_DIM, action_dim=ACTION_DIM, 
             mu=mu, theta=theta, sigma=sigma, gamma=gamma, tau=tau, train_type=TRAIN_TYPE,
             actor_lr=actor_lr, critic_lr=critic_lr, batch_size=batch_size, hmm_state=hmm_state)

# define ROS service client and messages
rospy.wait_for_service('/gazebo_env_io/pytorch_io_service')
pytorch_io_service = rospy.ServiceProxy('/gazebo_env_io/pytorch_io_service', SimpleCtrl)
TERMINAL_REWARD, COLLISION_REWARD, SURVIVE_REWARD = utils.get_parameters('../../gazebo_drl_env/param/env.yaml')

# load parameters of pre-trained CA
model.load_models()
model.copy_weights()
model.noise.reset()

print('[*] State  Dimensions : {}'.format(STATE_DIM))
print('[*] Sensor Dimensions : {}'.format(SENSOR_DIM))
print('[*] Action Dimensions : {}'.format(ACTION_DIM))
示例#3
0
# update parameters
gamma = 0.99
tau = 0.001
hmm_state = 10

## ------------------------------

# define model
model = HNRN(max_buffer=0,
             state_dim=STATE_DIM,
             sensor_dim=SENSOR_DIM,
             target_dim=TARGET_DIM,
             action_dim=ACTION_DIM,
             mu=mu,
             theta=theta,
             sigma=sigma,
             gamma=gamma,
             tau=tau,
             train_type=TRAIN_TYPE,
             actor_lr=actor_lr,
             critic_lr=critic_lr,
             batch_size=batch_size,
             hmm_state=hmm_state)

# define ROS service client and messages
rospy.wait_for_service('/gazebo_env_io/pytorch_io_service')
pytorch_io_service = rospy.ServiceProxy('/gazebo_env_io/pytorch_io_service',
                                        SimpleCtrl)
TERMINAL_REWARD, COLLISION_REWARD, SURVIVE_REWARD = utils.get_parameters(
    '../../gazebo_drl_env/param/env.yaml')
示例#4
0
batch_size = 256
# update parameters
gamma = 0.99
tau = 0.001
hmm_state = 10

## ------------------------------

# define model
model = HNRN(max_buffer=0,
             state_dim=STATE_DIM,
             sensor_dim=SENSOR_DIM,
             action_dim=ACTION_DIM,
             mu=mu,
             theta=theta,
             sigma=sigma,
             gamma=gamma,
             tau=tau,
             train_type=TRAIN_TYPE,
             actor_lr=actor_lr,
             critic_lr=critic_lr,
             batch_size=batch_size,
             hmm_state=hmm_state)

# define ROS service client and messages
rospy.wait_for_service('/gazebo_env_io/pytorch_io_service')
pytorch_io_service = rospy.ServiceProxy('/gazebo_env_io/pytorch_io_service',
                                        SimpleCtrl)
TERMINAL_REWARD, COLLISION_REWARD, SURVIVE_REWARD = utils.get_parameters(
    '../../gazebo_drl_env/param/env.yaml')

# load parameters of pre-trained model