本文整理汇总了C++中Network::classify_from_file方法的典型用法代码示例。如果您正苦于以下问题:C++ Network::classify_from_file方法的具体用法?C++ Network::classify_from_file怎么用?C++ Network::classify_from_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network::classify_from_file方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WinMain
//.........这里部分代码省略.........
sprintf ( msg , "Illegal CLASSIFY OUTPUT: %s", rest ) ;
error_message ( msg ) ;
}
else if (n > n_outputs) {
sprintf ( msg , "CLASSIFY OUTPUT (%d) exceeds N OUTPUTS (%d)",
n, n_outputs ) ;
error_message ( msg ) ;
}
else
classif_output = n ;
continue ;
}
if (! strcmp ( command , "OUTPUT FILE" )) {
strcpy ( out_file , rest ) ;
continue ;
}
if (! strcmp ( command , "EXECUTE" ))
{
if (network == NULL)
error_message ( "There is no trained network" ) ;
else
{
network->execute_from_file ( rest , out_file) ;
continue ;
}
}
if (! strcmp ( command , "TEST NETWORK" ))
{
if (network == NULL)
error_message ( "There is no trained network" ) ;
else
{
network->test_from_file ( rest ,out_file,net_model) ;
continue ;
}
}
if (! strcmp ( command , "CLASSIFY" )) {
if (network == NULL)
error_message ( "There is no trained network" ) ;
else if (out_model != OUTMOD_CLASSIFY)
error_message ( "CLASSIFY valid only in CLASSIFY output mode" ) ;
else
network->classify_from_file ( rest , threshold ) ;
continue ;
}
if (! strcmp ( command , "RESET CONFUSION" )) {
if (network == NULL)
error_message ( "There is no trained network" ) ;
else
network->reset_confusion () ;
continue ;
}
if (! strcmp ( command , "CONFUSION THRESHOLD" )) {
p = atof ( rest ) ;
if ((p < 0.0) || (p > 100.0)) {
sprintf ( msg , "Illegal CONFUSION THRESHOLD: %s", rest ) ;
error_message ( msg ) ;
}
else
threshold = p / 100.0 ;
continue ;
}
if (! strcmp ( command , "SHOW CONFUSION" )) {
if (network == NULL)
error_message ( "There is no trained network" ) ;
else if (out_model != OUTMOD_CLASSIFY)
error_message ( "CONFUSION valid only in CLASSIFY output mode" ) ;
else
network->show_confusion () ;
continue ;
}
if (! strcmp ( command , "SAVE CONFUSION" )) {
if (network == NULL)
error_message ( "There is no trained network" ) ;
else if (out_model != OUTMOD_CLASSIFY)
error_message ( "CONFUSION valid only in CLASSIFY output mode" ) ;
else
network->save_confusion ( rest ) ;
continue ;
}
sprintf ( msg , "Unknown command: %s", command ) ;
error_message ( msg ) ;
} // Endless command loop
MEMTEXT ( "NEURAL: control_line, msg" ) ;
FREE ( control_line ) ;
FREE ( msg ) ;
MEMCLOSE () ;
exit ( 0 ) ;
}
示例2: main
//.........这里部分代码省略.........
continue ;
}
if (n_outputs < 0) {
error_message ( "CLASSIFY OUTPUT used before N OUTPUTS set." ) ;
continue ;
}
if (out_model != OUTMOD_CLASSIFY) {
error_message
( "CLASSIFY OUTPUT only valid when OUTPUT MODEL:CLASSIFY" ) ;
continue ;
}
m = sscanf ( rest , "%d" , &n ) ;
if ((m <= 0) || (n < 0)) {
sprintf ( msg , "Illegal CLASSIFY OUTPUT: %s", rest ) ;
error_message ( msg ) ;
}
else if (n > n_outputs) {
sprintf ( msg , "CLASSIFY OUTPUT (%d) exceeds N OUTPUTS (%d)",
n, n_outputs ) ;
error_message ( msg ) ;
}
else
classif_output = n ;
continue ;
}
if (! strcmp ( command , "OUTPUT FILE" )) {
strcpy ( out_file , rest ) ;
continue ;
}
if (! strcmp ( command , "EXECUTE" )) {
if (network == NULL)
error_message ( "There is no trained network" ) ;
else
network->execute_from_file ( rest , out_file ) ;
continue ;
}
if (! strcmp ( command , "CLASSIFY" )) {
if (network == NULL)
error_message ( "There is no trained network" ) ;
else if (out_model != OUTMOD_CLASSIFY)
error_message ( "CLASSIFY valid only in CLASSIFY output mode" ) ;
else
network->classify_from_file ( rest , threshold ) ;
continue ;
}
if (! strcmp ( command , "RESET CONFUSION" )) {
if (network == NULL)
error_message ( "There is no trained network" ) ;
else
network->reset_confusion () ;
continue ;
}
if (! strcmp ( command , "CONFUSION THRESHOLD" )) {
p = atof ( rest ) ;
if ((p < 0.0) || (p > 100.0)) {
sprintf ( msg , "Illegal CONFUSION THRESHOLD: %s", rest ) ;
error_message ( msg ) ;
}
else
threshold = p / 100.0 ;
continue ;
}
if (! strcmp ( command , "SHOW CONFUSION" )) {
if (network == NULL)
error_message ( "There is no trained network" ) ;
else if (out_model != OUTMOD_CLASSIFY)
error_message ( "CONFUSION valid only in CLASSIFY output mode" ) ;
else
network->show_confusion () ;
continue ;
}
if (! strcmp ( command , "SAVE CONFUSION" )) {
if (network == NULL)
error_message ( "There is no trained network" ) ;
else if (out_model != OUTMOD_CLASSIFY)
error_message ( "CONFUSION valid only in CLASSIFY output mode" ) ;
else
network->save_confusion ( rest ) ;
continue ;
}
sprintf ( msg , "Unknown command: %s", command ) ;
error_message ( msg ) ;
} // Endless command loop
MEMTEXT ( "NEURAL: control_line, msg" ) ;
FREE ( control_line ) ;
FREE ( msg ) ;
MEMCLOSE () ;
return 0 ;
}