当前位置: 首页>>代码示例>>C++>>正文


C++ Network::StoreAnalysis方法代码示例

本文整理汇总了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();
}
开发者ID:bernhardkaplan,项目名称:nexa,代码行数:101,代码来源:NetworkTests.cpp


注:本文中的Network::StoreAnalysis方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。