📄 perceptron.h
字号:
// -*-c++-*-//===========================================================//= University of Illinois at Urbana-Champaign =//= Department of Computer Science =//= Dr. Dan Roth - Cognitive Computation Group =//= =//= Project: SNoW =//= =//= Module: Perceptron.h =//= Version: 3.2.0 =//= Authors: Jeff Rosen, Andrew Carlson, Nick Rizzolo =//= Date: xx/xx/99 = //= =//= Comments: =//===========================================================#ifndef PERCEPTRON_H__#define PERCEPTRON_H__#include "LearningAlgorithm.h"class GlobalParams;class Perceptron : public LearningAlgorithm{ public: Perceptron( GlobalParams & gp_, double learningRate = 0.10, double threshold = 1.0, double defaultWeight = 0.10 );// Perceptron( GlobalParams & gp_ ); void UpdateCounts( Target& tar, Example& ex ); bool PresentExample( Target& tar, Example& ex ); void PerformPercentageEligibility( Target& tar ); void TrainingComplete( Target& tar ); // Updates the target based on the example and the Perceptron parameters // The decision on how to update has been moved out of the Update // function, thus the third parameter. void Update( Target& tar, Example& ex, bool promote ); void SetTargetActivation( Target& tar, Example& ex ); double ReturnNormalizedActivation( Target& tar); void Show( ostream* out ); void Read( ifstream& in ); void Write( ofstream& out ); private: double learningRate; GlobalParams & globalParams;};inline Perceptron::Perceptron( GlobalParams & gp_, double lr, double th, double dw ) : LearningAlgorithm(th, dw), learningRate (lr), globalParams(gp_){}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -