本文整理汇总了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);
}
}