// NetQuality.cc // Kevin Karplus // 25 July 1998 #include #include #include "Regularizer/BackgroundProbs.h" #include "Globals.h" #include "NetQuality.h" void NetQuality::print_data_header(ofstream& out) const { out << "# " << Net->name() << " (" << Net->degrees_freedom() << " degrees of freedom)" << "\n"; out << "# training data for layers:"; int lay; for (lay=0; layis_layer_hidden(lay)) out << " " << lay << "=" << Net->layer(lay)->name(); } out << endl; out << "# unfrozen layers:"; for (lay=0; laylayer(lay)->is_frozen()) out << " " << lay << "=" << Net->layer(lay)->name(); } out << endl; for (int lay=0; layis_layer_hidden(lay)) continue; out << "#Epoch layer "; QR[lay]->print_header(out); // out << "# null bits=" << QR[lay]->null_cost()*M_LOG2E << "\n"; const InterfaceDescription* ifd = Net->interface(lay+1); const BackgroundProbs* NullProbs= Globals::background_probs(ifd->Alpha,ZeroIfNew); if (NullProbs) { out << "# null-model entropy = " << NullProbs->entropy() << " bits\n"; } } } //CHANGE LOG: // 25 July 1998 Kevin Karplus // Moved print_data_header so no longer inline // and added code from NeuralNet::learning_loop // 8 Jan 2001 Kevin Karplus // Added null_cost output to header. // Sat Jun 18 23:09:18 PDT 2005 Kevin Karplus // Modified null_cost output to header to be more obviously just // an entropy of the null model, independent of test data. // Thu Jul 7 04:57:38 PDT 2005 Kevin Karplus // Fixed spacing before print_header() // Sat Jul 9 11:25:50 PDT 2005 Kevin Karplus // Adjusted spacing before print_header() for change in header. // Sun Jul 10 10:06:50 PDT 2005 Kevin Karplus // Corrected double-scaling of entropy of BackgroundProbs, since // BackgroundProbs::entropy() already returns bits.