-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathneuralparser.h
50 lines (46 loc) · 1.19 KB
/
neuralparser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# ifndef __NEURALPARSER__H
# define __NEURALPARSER__H
# include <string>
# include <vector>
using namespace std;
typedef vector<double> Data;
struct Multiplier
{
double m;
int index;
};
struct Node
{
double out;
vector<Multiplier> mult;
double bias;
};
class NeuralParser
{
private:
int dimension;
vector<int> fixstatus;
vector<Node> node;
vector<double> weight;
public:
NeuralParser(int Dimension);
int getDimension() const;
void makeVector(string str);
void getWeights(vector<double> &w);
void getFixStatus(vector<int> &status);
void setWeights(vector<double> w);
double eval(vector<double> xpoint);
double eval(double *xpoint);
double evalDeriv(vector<double> xpoint,int pos);
double evalDeriv2(vector<double> xpoint,int pos);
double evalDeriv3(vector<double> xpoint,int pos);
void getDeriv(vector<double> xpoint,vector<double> &g);
void getXDeriv(vector<double> xpoint,int pos,vector<double> &g);
void getX2Deriv(vector<double> xpoint,int pos,vector<double> &g);
void getX3Deriv(vector<double> xpoint,int pos,vector<double> &g);
virtual double valError();
void getMargins(Data &l,Data &r);
string print();
~NeuralParser();
};
# endif