当前位置: 首页>>代码示例>>C++>>正文


C++ Trajectory::initial_y方法代码示例

本文整理汇总了C++中Trajectory::initial_y方法的典型用法代码示例。如果您正苦于以下问题:C++ Trajectory::initial_y方法的具体用法?C++ Trajectory::initial_y怎么用?C++ Trajectory::initial_y使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Trajectory的用法示例。


在下文中一共展示了Trajectory::initial_y方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: train

void Dmp::train(const Trajectory& trajectory, string save_directory, bool overwrite)
{
  
  // Set tau, initial_state and attractor_state from the trajectory 
  set_tau(trajectory.duration());
  set_initial_state(trajectory.initial_y());
  set_attractor_state(trajectory.final_y());
  
  VectorXd fa_input_phase;
  MatrixXd f_target;
  computeFunctionApproximatorInputsAndTargets(trajectory, fa_input_phase, f_target);
  
  // Some checks before training function approximators
  assert(!function_approximators_.empty());
  
  for (unsigned int dd=0; dd<function_approximators_.size(); dd++)
  {
    // This is just boring stuff to figure out if and where to store the results of training
    string save_directory_dim;
    if (!save_directory.empty())
    {
      if (function_approximators_.size()==1)
        save_directory_dim = save_directory;
      else
        save_directory_dim = save_directory + "/dim" + boost::lexical_cast<string>(dd);
    }
    
    // Actual training is happening here.
    VectorXd fa_target = f_target.col(dd);
    if (function_approximators_[dd]->isTrained())
      function_approximators_[dd]->reTrain(fa_input_phase,fa_target,save_directory_dim,overwrite);
    else
      function_approximators_[dd]->train(fa_input_phase,fa_target,save_directory_dim,overwrite);
  }
}
开发者ID:humm,项目名称:dovecot,代码行数:35,代码来源:Dmp.cpp


注:本文中的Trajectory::initial_y方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。