本文整理汇总了C#中BasicNetwork.GetLayerNeuronCount方法的典型用法代码示例。如果您正苦于以下问题:C# BasicNetwork.GetLayerNeuronCount方法的具体用法?C# BasicNetwork.GetLayerNeuronCount怎么用?C# BasicNetwork.GetLayerNeuronCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BasicNetwork
的用法示例。
在下文中一共展示了BasicNetwork.GetLayerNeuronCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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>();
for (int layerNumber = 0; layerNumber < network.LayerCount - 1; layerNumber++)
{
int fromCount = network.GetLayerNeuronCount(layerNumber);
int fromBiasCount = network
.GetLayerTotalNeuronCount(layerNumber);
int toCount = network.GetLayerNeuronCount(layerNumber + 1);
// weights
for (int fromNeuron = 0; fromNeuron < fromCount; fromNeuron++)
{
for (int toNeuron = 0; toNeuron < toCount; toNeuron++)
{
double v = network.GetWeight(layerNumber, fromNeuron,
toNeuron);
if (network.Structure.ConnectionLimited )
{
if (Math.Abs(v) < network.Structure.ConnectionLimit )
{
assignDisabled++;
}
}
weightList.Add(v);
allList.Add(v);
assignedTotal++;
}
}
// bias
if (fromCount != fromBiasCount)
{
int biasNeuron = fromCount;
for (int toNeuron = 0; toNeuron < toCount; toNeuron++)
{
double v = network.GetWeight(layerNumber, biasNeuron,
toNeuron);
if (network.Structure.ConnectionLimited)
{
if (Math.Abs(v) < network.Structure.ConnectionLimit)
{
assignDisabled++;
}
}
biasList.Add(v);
allList.Add(v);
assignedTotal++;
}
}
}
_disabledConnections = assignDisabled;
_totalConnections = assignedTotal;
_weights = new NumericRange(weightList);
_bias = new NumericRange(biasList);
_weightsAndBias = new NumericRange(allList);
_weightValues = EngineArray.ListToDouble(weightList);
_allValues = EngineArray.ListToDouble(allList);
_biasValues = EngineArray.ListToDouble(biasList);
}
示例2: AnalyzeNetwork
/// <summary>
/// Construct a network analyze class. Analyze the specified network.
/// </summary>
///
/// <param name="network">The network to analyze.</param>
public AnalyzeNetwork(BasicNetwork network)
{
IList<Double> biasList = new List<Double>();
IList<Double> weightList = new List<Double>();
IList<Double> allList = new List<Double>();
for (int layerNumber = 0; layerNumber < network.LayerCount - 1; layerNumber++)
{
int fromCount = network.GetLayerNeuronCount(layerNumber);
int fromBiasCount = network
.GetLayerTotalNeuronCount(layerNumber);
int toCount = network.GetLayerNeuronCount(layerNumber + 1);
// weights
for (int fromNeuron = 0; fromNeuron < fromCount; fromNeuron++)
{
for (int toNeuron = 0; toNeuron < toCount; toNeuron++)
{
double v = network.GetWeight(layerNumber, fromNeuron,
toNeuron);
weightList.Add(v);
allList.Add(v);
}
}
// bias
if (fromCount != fromBiasCount)
{
int biasNeuron = fromCount;
for (int toNeuron = 0; toNeuron < toCount; toNeuron++)
{
double v = network.GetWeight(layerNumber, biasNeuron,
toNeuron);
biasList.Add(v);
allList.Add(v);
}
}
}
_disabledConnections = 0;
_totalConnections = 0;
_weights = new NumericRange(weightList);
_bias = new NumericRange(biasList);
_weightsAndBias = new NumericRange(allList);
_weightValues = EngineArray.ListToDouble(weightList);
_allValues = EngineArray.ListToDouble(allList);
_biasValues = EngineArray.ListToDouble(biasList);
}