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


C++ ioHandler::readBegin方法代码示例

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


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

示例1: read

  /*
   * read the classifier from the given ioHandler
   */
  bool svm::read(ioHandler& handler,const bool complete) {
    bool b=true;
    if (complete) {
      b=handler.readBegin();
    }
    b = b && supervisedInstanceClassifier::read(handler,false);
    if (b) {
      b=b && lti::read(handler, "nClasses",nClasses);
      b=b && lti::read(handler, "alpha",alpha);
      delete trainData;
      dmatrix* t=new dmatrix();
      b=b && lti::read(handler, "vectors",*t);
      trainData=t;
      b=b && lti::read(handler, "idMap",idMap);
      b=b && lti::read(handler, "rIdMap",rIdMap);
      b=b && lti::read(handler, "srcIds",srcIds);
      b=b && lti::read(handler, "bias", bias);
      int n;
      b=b && lti::read(handler, "nKernels", n);
      //kernels.
      b=b && handler.readBegin();
      b=b && handler.trySymbol("kernels");
      className cn;
      std::string kname;
      kernels.resize(n);
      // always read the complete kernel vector, so we have the setup
      // ready to go without the need for any subsequent
      // initializations
      for (int i=0; i<n; i++) {
        b=b && lti::read(handler, "name", kname);
        if (kname != "unknown") {
          kernels[i]=getParameters().createKernel(kname);
          b=b && kernels[i]->read(handler);
        } else {
          kernels[i]=0;
        }
      }
      b=b && handler.readEnd();
      b=b && lti::read(handler, "offset", offset);
      b=b && lti::read(handler, "scale", scale);
      rebuildTargets();
      defineOutputTemplate();
    }
    if (complete) {
      b=b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:52,代码来源:ltiSVM.cpp

示例2: bool

  bool regionMerge::parameters::readMS(ioHandler& handler,
                                          const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {

      lti::read(handler,"threshold",threshold);
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && functor::parameters::read(handler,false);
# else
    bool (functor::parameters::* p_readMS)(ioHandler&,const bool) =
      functor::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:30,代码来源:ltiRegionMerge.cpp

示例3: bool

  bool histogramRGBL::parameters::readMS(ioHandler& handler,
                                          const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {

      lti::read(handler,"smooth",smooth);
      lti::read(handler,"normalize",normalize);
      lti::read(handler,"cells",cells);
      lti::read(handler,"considerAllData",considerAllData);
      lti::read(handler,"ignoreValue",ignoreValue);
      lti::read(handler,"kernel",kernel);
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && globalFeatureExtractor::parameters::read(handler,false);
# else
    bool (globalFeatureExtractor::parameters::* p_readMS)(ioHandler&,const bool) =
      globalFeatureExtractor::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:35,代码来源:ltiHistogramRGBL.cpp

示例4: bool

  bool fastViewer::parameters::readMS(ioHandler& handler,
                                          const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {
      lti::read(handler, "topleft" ,topleft);
      lti::read(handler, "noBorder" ,noBorder);
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && viewerBase::parameters::read(handler,false);
# else
    bool (viewerBase::parameters::* p_readMS)(ioHandler&,const bool) =
      viewerBase::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:30,代码来源:ltiFastViewer.cpp

示例5: bool

  bool huMoments::parameters::readMS(ioHandler& handler,
                                          const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {

      lti::read(handler,"scaling",scaling);
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && globalFeatureExtractor::parameters::read(handler,false);
# else
    bool (globalFeatureExtractor::parameters::* p_readMS)(ioHandler&,const bool) =
      globalFeatureExtractor::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:30,代码来源:ltiHuMoments.cpp

示例6: bool

  bool kNearestNeighFilter::parameters::readMS(ioHandler& handler,
                                          const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {

	lti::read(handler,"kernelSize",kernelSize);
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && filter::parameters::read(handler,false);
# else
    bool (filter::parameters::* p_readMS)(ioHandler&,const bool) =
      filter::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:30,代码来源:ltiKNearestNeighFilter.cpp

示例7: bool

  bool sigmoidKernel::parameters::readMS(ioHandler& handler,
                                          const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {
      b=b && lti::read(handler, "kappa", kappa);
      b=b && lti::read(handler, "theta", theta);
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && kernelFunctor<double>::parameters::read(handler,false);
# else
    bool (kernelFunctor<double>::parameters::* p_readMS)(ioHandler&,const bool) =
      kernelFunctor<double>::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:30,代码来源:ltiSigmoidKernel.cpp

示例8: read

  // read method
  bool MLP::read(ioHandler& handler,const bool complete) {
    bool b(true);

    if (complete) {
      b = handler.readBegin();
    }

    // read the standard data (output and parameters)
    supervisedInstanceClassifier::read(handler,false);

    if (b) {
      if (lti::read(handler,"inputs",inputs) && 
          lti::read(handler,"outputs",outputs)) {
        if (lti::read(handler,"weights",weights)) {
          b = initWeights(true); // initialize internal state keeping
          // the weights...
        } else {
          initWeights(false,-1,1);
          b = false;
        }
      } else {
        b = false;
      }
    }

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:32,代码来源:ltiMLP.cpp

示例9: bool

  bool binomialDistribution::parameters::readMS(ioHandler& handler,
                                          const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {

      lti::read(handler,"sampleSize",sampleSize);
      lti::read(handler,"events",events);
      lti::read(handler,"confidence",confidence);
      lti::read(handler,"accuracy",accuracy);
      lti::read(handler,"baseProbability",baseProbability);
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && discreteRandomDistribution::parameters::read(handler,false);
# else
    bool (discreteRandomDistribution::parameters::* p_readMS)(ioHandler&,const bool) =
      discreteRandomDistribution::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:34,代码来源:ltiBinomialDistribution.cpp

示例10: bool

  bool medianCut::parameters::readMS(ioHandler& handler,
                                          const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {

      lti::read(handler,"preQuant",preQuant);
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && colorQuantization::parameters::read(handler,false);
# else
    bool (colorQuantization::parameters::* p_readMS)(ioHandler&,const bool) =
      colorQuantization::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:30,代码来源:ltiMedianCut.cpp

示例11: bool

  bool labelAdjacencyMap::parameters::readMS(ioHandler& handler,
                                          const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {

      lti::read(handler,"minColors",minColors);
      lti::read(handler,"thePalette",thePalette);
      lti::read(handler,"neighborhood",neighborhood);
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && functor::parameters::read(handler,false);
# else
    bool (functor::parameters::* p_readMS)(ioHandler&,const bool) =
      functor::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:32,代码来源:ltiLabelAdjacencyMap.cpp

示例12: bool

  bool SOFM2D::parameters::readMS(ioHandler& handler,
                                          const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {

      lti::read(handler,"area",area);
      lti::read(handler,"sizeX",sizeX);
      lti::read(handler,"sizeY",sizeY);
      lti::read(handler,"calculateSize",calculateSize);
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && SOFM::parameters::read(handler,false);
# else
    bool (SOFM::parameters::* p_readMS)(ioHandler&,const bool) =
      SOFM::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:33,代码来源:ltiSOFM2D.cpp

示例13: bool

  bool homography8DofEstimator::parameters::readMS(ioHandler& handler,
                                                   const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {
      
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && homographyEstimatorBase::parameters::read(handler,false);
# else
    bool (homographyEstimatorBase::parameters::* p_readMS)
      (ioHandler&,const bool)=
      homographyEstimatorBase::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:30,代码来源:ltiHomography8DofEstimator.cpp

示例14: if

    bool hessianFunctor::parameters::readMS(ioHandler& handler,
                                            const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {

      std::string str;
            
      lti::read(handler,"kernelType",str);
      if (str == "Ando") {
        kernelType = Ando;
      } else if (str == "OGD") {
        kernelType = OGD2;
      } else if (str == "Classic") {
        kernelType = Classic;
      } else if (str == "Sobel") {        
        kernelType = Sobel;
      } else if (str == "Prewitt") {        
        kernelType = Prewitt;
      } else if (str == "Robinson") {        
        kernelType = Robinson;
      } else if (str == "Kirsch") {        
        kernelType = Kirsch;
      } else if (str == "Harris") {        
        kernelType = Harris;
      } else if (str == "Hessian") {        
        kernelType = Hessian;
      } else {
        kernelType = Hessian;
        handler.setStatusString("Unknown kernel type");
        b = false;
      }

      lti::read(handler,"kernelSize",kernelSize);
      lti::read(handler,"kernelVariance",kernelVariance);
    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && transform::parameters::read(handler,false);
# else
    bool (transform::parameters::* p_readMS)(ioHandler&,const bool) =
      transform::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:58,代码来源:ltiHessianFunctor.cpp

示例15: bool

  bool MLP::parameters::readMS(ioHandler& handler,
                                          const bool complete)
# endif
  {
    bool b = true;
    if (complete) {
      b = handler.readBegin();
    }

    if (b) {
      std::string str;
      lti::read(handler,"trainingMode",str);
      if (str == "ConjugateGradients") {
        trainingMode = ConjugateGradients;
      } else {
        trainingMode = SteepestDescent;
      }

      lti::read(handler,"batchMode",batchMode);
      lti::read(handler,"momentum",momentum);
      lti::read(handler,"hiddenUnits",hiddenUnits);
      lti::read(handler,"learnrate",learnrate);
      lti::read(handler,"maxNumberOfEpochs",maxNumberOfEpochs);
      lti::read(handler,"stopError",stopError);

      unsigned int i;

      for (i=0;i<activationFunctions.size();++i) {
        delete activationFunctions[i];
      }
      
      const int layers = hiddenUnits.size()+1;
      activationFunctions.resize(layers);
      std::string className;
      for (i=0;i<activationFunctions.size();++i) {
        lti::read(handler,"activationFunctorType",className);
        activationFunctions[i] = objFactory.newInstance(className);
        lti::read(handler,"functor",*activationFunctions[i]);
      }

    }

# ifndef _LTI_MSC_6
    // This is the standard C++ code, which MS Visual C++ 6 is not able to
    // compile...
    b = b && supervisedInstanceClassifier::parameters::read(handler,false);
# else
    bool (supervisedInstanceClassifier::parameters::* p_readMS)(ioHandler&,const bool) =
      supervisedInstanceClassifier::parameters::readMS;
    b = b && (this->*p_readMS)(handler,false);
# endif

    if (complete) {
      b = b && handler.readEnd();
    }

    return b;
  }
开发者ID:mvancompernolle,项目名称:ai_project,代码行数:58,代码来源:ltiMLP.cpp


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