⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 model.h

📁 Amis - A maximum entropy estimator 一个最大熵模型统计工具
💻 H
字号:
////////////////////////////////////////////////////////////////////////////  Copyright (c) 2000, Yusuke Miyao///  You may distribute under the terms of the Artistic License.//////  <id>$Id: Model.h,v 1.8 2003/05/13 05:49:45 yusuke Exp $</id>///  <collection>Maximum Entropy Estimator</collection>///  <name>Model.h</name>///  <overview>A set of feature weights</overview>///  <desc>///  This file provides the definitions of the Model class.///  </desc>/////////////////////////////////////////////////////////////////////////#ifndef Amis_Model_h_#define Amis_Model_h_#include <amis/configure.h>#include <amis/Real.h>#include <amis/ModelBase.h>#include <amis/NameTable.h>#include <string>#include <iostream>AMIS_NAMESPACE_BEGIN///////////////////////////////////////////////////////////////////////// <classdef>/// <name>Model</name>/// <overview>Model</overview>/// <body>template < class Name = std::string >class Model : public ModelBase {private:  NameTable< Name > name_table;public:  Model() {}  virtual ~Model() {}  std::string modelName() const { return "Model"; }  std::string featureNameString( FeatureID id ) const {    return name_table.featureNameString( id );  }  const Name& featureName( FeatureID id ) const {    return name_table.featureName( id );  }  FeatureID featureID( const Name& name ) const {    return name_table.featureID( name );  }  FeatureID newFeature( const Name& name, Real l ) {    FeatureID id = ModelBase::newFeature( l );    name_table.registerNewFeature( name, id );    return id;  }public:  // Debugging  void debugInfo( std::ostream& ostr ) const {    ostr << "====================\n";    ostr << "Feature\tLambda\n";    for ( int i = 0; i < numFeatures(); ++i )      ostr << name_table.featureNameString( i ) << '\t' << getLambda( i ) << '\n';    ostr << "====================\n";  }};AMIS_NAMESPACE_END#endif // Model_h_// end of Model.h

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -