Пример #1
0
//----------------------------------------------------------------
//
// NAME: GetNumberOutput
//
//
// DESCRIPTION:
//
// Return the number of output units in a --SIMPLE-- local_net
// By simple we mean that there is only one output layer and it is the last
// layer. 
// After some thought, decided to return 0 as the number if it cannot
// figure what the input layer (ie default return value is 0)
//---------------------------------------------------------------
int CNeuralNet::GetOutputCount()
{
    ULONG		cOutput = 0;
    HRESULT     hr = GetNumClasses(&cOutput);

    if (FAILED(hr))
    {
        return 0;
    }

    return (int)cOutput;
}
Пример #2
0
    virtual void Merge(std::shared_ptr<AbstractStatistics> OtherStats) override
    {
	std::shared_ptr<StructDataStats> DerivedOtherStats = std::dynamic_pointer_cast<StructDataStats>(OtherStats);
	if(DerivedOtherStats->GetNumClasses() != GetNumClasses())
	    throw std::runtime_error("Cannot merge statistics. Number of classes don't match. Exiting.");

	// std::cout << DerivedOtherStats->GetNumClasses() << std::endl;
	// std::cout << GetNumClasses() << std::endl;
	// if(isAggregated() != true || DerivedOtherStats->isAggregated() != true)
	//     throw std::runtime_error("Cannot merge statistics. One of them is not aggregated yet. Exiting.");

	if(DerivedOtherStats == nullptr)
	    throw std::runtime_error("Incoming statistics is null. Please check input. Exiting.");

	m_nDataPoints += DerivedOtherStats->GetNumDataPoints();
	for(int i = 0; i < m_nClassesPerDim; ++i)
	    m_DimClassBins[i] += DerivedOtherStats->GetBins()[i];

	m_isAggregated = true;
    };