Exemple #1
0
 def output(self, episode, label = 'T'):
     if label == 'V-VIS':
         start = 0
         sim_traj = []
         while start in self.F_ward:
             sim_traj.append(self.ori_traj_set[episode][start])
             start = self.F_ward[start][1]
         sim_traj.append(self.ori_traj_set[episode][start])
         _, final_error = F.sed_error(self.ori_traj_set[episode], sim_traj)
         print('Validation at episode {} with error {}'.format(episode, final_error))
         #for visualization, 'sed' is by default, if you want to draw other errors by revising the codes in data_utils.py correspondingly.
         F.draw(self.ori_traj_set[episode], sim_traj) 
         return final_error
     if label == 'V':
         start = 0
         sim_traj = []
         while start in self.F_ward:
             sim_traj.append(self.ori_traj_set[episode][start])
             start = self.F_ward[start][1]
         sim_traj.append(self.ori_traj_set[episode][start])
         _, final_error = F.sed_error(self.ori_traj_set[episode], sim_traj)
         return final_error
     if label == 'T':
         print('Training at episode {} with error {}'.format(episode, self.current))
         return self.current
 def output(self, episode, label='T', err_bounded=0.0002):
     if label == 'VIS':
         F.draw(self.ori_traj_set[episode], self.simplified_tra)
     return len(self.simplified_tra) / self.N