本文整理汇总了C++中Network::StoreAnalysis方法的典型用法代码示例。如果您正苦于以下问题:C++ Network::StoreAnalysis方法的具体用法?C++ Network::StoreAnalysis怎么用?C++ Network::StoreAnalysis使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network::StoreAnalysis方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NetworkTestInclTimingBCPNNRecurrent
//.........这里部分代码省略.........
network->AddPopulation(layer1);
FullConnectivity* full = new FullConnectivity();//false,"minicolumns");
full->SetRandomWeights(0,0);
RandomConnectivity* randConn = new RandomConnectivity(probConnectivity);//0.1);
randConn->SetRandomWeights(0,0);
//network->AddTiming(randConn);
layer1->AddPre(layer1,randConn); // recurrent
// Add Projection changes
float lambda0 = 10e-6;
float alpha = 0.05;
ProjectionModifierBcpnnOnline* bStandard = new ProjectionModifierBcpnnOnline(alpha,lambda0);
//full->AddProjectionsEvent(bStandard);
randConn->AddProjectionsEvent(bStandard);
WTA* wta = new WTA();
layer1->AddPopulationModifier(wta);
// Construct initial network
network->Initialize();
//vector<int> partsOfDataToUseAsInput = layer1->GetMPIDistribution(network->MPIGetNodeId());
// Specify input data
// - change to only create local part
DataSources source;
// not correct right now as SetValuesAll working locally and this is global
vector<vector<float> > data = source.GetRandomHCsOrthogonal(nrHypercolumns/100,nrRateUnits,nrItems);
// Meters
Meter* l1meter = new Meter("layer1.csv", Storage::CSV);
if(storeData)
{
l1meter->AttachPopulation(layer1);
network->AddMeter(l1meter);
}
Meter* c1meter = new Meter("Projections1.csv",Storage::CSV);
if(storeData)
{
c1meter->AttachProjection(layer1->GetIncomingProjections()[0],0);
network->AddMeter(c1meter);
}
// Timings
network->AddTiming(bStandard);
network->AddTiming(layer1);
network->AddTiming(full);
// need to access after it has been built
network->AddTiming(layer1->GetIncomingProjections()[0]);
// Training
// set fixed pattern
layer1->SwitchOnOff(false);
int trainIterations = 1;
int testIterations = 5;
for(int i=0;i<trainIterations;i++)
{
//cout<<i<<"\n";
for(int j=0;j<data.size();j++)
{
layer1->SetValuesAll(data[j]);
// next time step
network->Simulate(10);
}
}
// Testing
if(doTesting == true)
{
layer1->SwitchOnOff(true);
bStandard->SwitchOnOff(false);
for(int i=0;i<testIterations;i++)
{
for(int j=0;j<data.size();j++)
{
// clear all events before switching so no disturbance, can remove if moving average activity etc.
network->ClearEventsIncoming();
layer1->SetValuesAll(data[j]);
network->Simulate(10);
//for(int i=0;i<testIterations;i++)
// next time step
// network->Simulate();
}
}
}
network->RecordAll();
network->StoreAnalysis();
}