コード例 #1
0
int TrainingLayer::allocateDataStructures() {
   ANNLayer::allocateDataStructures();
   errno = 0;
   numTrainingLabels = readTrainingLabels( filename, &this->trainingLabels ); // trainingLabelsFromFile allocated within this readTrainingLabels call
   if( this->trainingLabels == NULL) return PV_FAILURE;
   if( numTrainingLabels <= 0) {
      fprintf(stderr, "Training Layer \"%s\": No training labels.  Exiting\n", name);
      exit( errno ? errno : EXIT_FAILURE );
   }
   return PV_SUCCESS;
}
コード例 #2
0
bool MNISTReader::readMNISTLabels(QString trainingFile, QString testFile)
{
    bool success = readTrainingLabels(trainingFile);
    if(!success)
    {
        qDebug() << "Can't read MNIST training labels";
        return false;
    }
    success = readTestLabels(testFile);
    if(!success)
    {
        qDebug() << "Cant' open MNIST test labels";
        return false;
    }
    qDebug() << "Success Readin labels" << endl;
    return true;
}