本文整理汇总了C#中BasicNetwork.IsConnected方法的典型用法代码示例。如果您正苦于以下问题:C# BasicNetwork.IsConnected方法的具体用法?C# BasicNetwork.IsConnected怎么用?C# BasicNetwork.IsConnected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BasicNetwork
的用法示例。
在下文中一共展示了BasicNetwork.IsConnected方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AnalyzeNetwork
/// <summary>
/// Construct a network analyze class. Analyze the specified network.
/// </summary>
/// <param name="network">The network to analyze.</param>
public AnalyzeNetwork(BasicNetwork network)
{
int assignDisabled = 0;
int assignedTotal = 0;
IList<double> biasList = new List<double>();
IList<double> weightList = new List<double>();
IList<double> allList = new List<double>();
foreach (ILayer layer in network.Structure.Layers)
{
if (layer.HasBias)
{
for (int i = 0; i < layer.NeuronCount; i++)
{
biasList.Add(layer.BiasWeights[i]);
allList.Add(layer.BiasWeights[i]);
}
}
}
foreach (ISynapse synapse in network.Structure.Synapses)
{
if (synapse.MatrixSize > 0)
{
for (int from = 0; from < synapse.FromNeuronCount; from++)
{
for (int to = 0; to < synapse.ToNeuronCount; to++)
{
if (network.IsConnected(synapse, from, to))
{
double d = synapse.WeightMatrix[from, to];
weightList.Add(d);
allList.Add(d);
}
else
{
assignDisabled++;
}
assignedTotal++;
}
}
}
}
this.disabledConnections = assignDisabled;
this.totalConnections = assignedTotal;
this.weights = new NumericRange(weightList);
this.bias = new NumericRange(biasList);
this.weightsAndBias = new NumericRange(allList);
this.weightValues = EngineArray.ListToDouble(weightList);
this.allValues = EngineArray.ListToDouble(allList);
this.biasValues = EngineArray.ListToDouble(biasList);
}