📄 neuralnetwork.h
字号:
/*
filename: NeuralNetWork.h
function: define the NeuralNet class
@copyright
date : 2008-12-22
author : loop111
e-mail : loop111@gmail.com
*/
#ifndef NEURALNETWORK_H
#define NEURALNETWORK_H
#include "NeuralNet.h"
#include "PR_unit.h"
#include<fstream>
#include<string>
class NeuralNetWork//Factory
{
public:
vector< PR_unit* > samples;
virtual void PrintSamples()
{
cout<<"Samples:"<<endl;
for(int i=0;i<samples.size();i++)
{
cout<<i<<":\t";
samples[i]->Print();
cout<<endl;
}
}
//Learning();//training method connections
//test();
//setLayer();
//protected:
virtual NeuralNet* CreateNet(){return NULL;};//Factory method
virtual NeuralNet* CreateNet(int *a,int n){return NULL;};//Factory method
};
class PerceptionNetWork:public NeuralNetWork
{
public:
NeuralNet* CreateNet()
{
int a[2] = {2,1};
int n = 2;
NeuralNet* net = new PerceptionNet(a,n);
return net;
}
};
class BPNetWork:public NeuralNetWork
{
public:
NeuralNet* CreateNet(int *a,int n)
{
NeuralNet* net = new BPNet(a,n);
return net;
}
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -