Home | History | Annotate | Download | only in src

Lines Matching refs:fs

1301 void CvANN_MLP::write_params( CvFileStorage* fs )
1312 cvWriteString( fs, "activation_function", activ_func_name );
1314 cvWriteInt( fs, "activation_function", activ_func );
1318 cvWriteReal( fs, "f_param1", f_param1 );
1319 cvWriteReal( fs, "f_param2", f_param2 );
1322 cvWriteReal( fs, "min_val", min_val );
1323 cvWriteReal( fs, "max_val", max_val );
1324 cvWriteReal( fs, "min_val1", min_val1 );
1325 cvWriteReal( fs, "max_val1", max_val1 );
1327 cvStartWriteStruct( fs, "training_params", CV_NODE_MAP );
1330 cvWriteString( fs, "train_method", "BACKPROP" );
1331 cvWriteReal( fs, "dw_scale", params.bp_dw_scale );
1332 cvWriteReal( fs, "moment_scale", params.bp_moment_scale );
1336 cvWriteString( fs, "train_method", "RPROP" );
1337 cvWriteReal( fs, "dw0", params.rp_dw0 );
1338 cvWriteReal( fs, "dw_plus", params.rp_dw_plus );
1339 cvWriteReal( fs, "dw_minus", params.rp_dw_minus );
1340 cvWriteReal( fs, "dw_min", params.rp_dw_min );
1341 cvWriteReal( fs, "dw_max", params.rp_dw_max );
1344 cvStartWriteStruct( fs, "term_criteria", CV_NODE_MAP + CV_NODE_FLOW );
1346 cvWriteReal( fs, "epsilon", params.term_crit.epsilon );
1348 cvWriteInt( fs, "iterations", params.term_crit.max_iter );
1349 cvEndWriteStruct( fs );
1351 cvEndWriteStruct( fs );
1357 void CvANN_MLP::write( CvFileStorage* fs, const char* name )
1368 cvStartWriteStruct( fs, name, CV_NODE_MAP, CV_TYPE_NAME_ML_ANN_MLP );
1370 cvWrite( fs, "layer_sizes", layer_sizes );
1372 write_params( fs );
1374 cvStartWriteStruct( fs, "input_scale", CV_NODE_SEQ + CV_NODE_FLOW );
1375 cvWriteRawData( fs, weights[0], layer_sizes->data.i[0]*2, "d" );
1376 cvEndWriteStruct( fs );
1378 cvStartWriteStruct( fs, "output_scale", CV_NODE_SEQ + CV_NODE_FLOW );
1379 cvWriteRawData( fs, weights[l_count], layer_sizes->data.i[l_count-1]*2, "d" );
1380 cvEndWriteStruct( fs );
1382 cvStartWriteStruct( fs, "inv_output_scale", CV_NODE_SEQ + CV_NODE_FLOW );
1383 cvWriteRawData( fs, weights[l_count+1], layer_sizes->data.i[l_count-1]*2, "d" );
1384 cvEndWriteStruct( fs );
1386 cvStartWriteStruct( fs, "weights", CV_NODE_SEQ );
1389 cvStartWriteStruct( fs, 0, CV_NODE_SEQ + CV_NODE_FLOW );
1390 cvWriteRawData( fs, weights[i], (layer_sizes->data.i[i-1]+1)*layer_sizes->data.i[i], "d" );
1391 cvEndWriteStruct( fs );
1394 cvEndWriteStruct( fs );
1400 void CvANN_MLP::read_params( CvFileStorage* fs, CvFileNode* node )
1406 const char* activ_func_name = cvReadStringByName( fs, node, "activation_function", 0 );
1414 activ_func = cvReadIntByName( fs, node, "activation_function" );
1416 f_param1 = cvReadRealByName( fs, node, "f_param1", 0 );
1417 f_param2 = cvReadRealByName( fs, node, "f_param2", 0 );
1421 min_val = cvReadRealByName( fs, node, "min_val", 0. );
1422 max_val = cvReadRealByName( fs, node, "max_val", 1. );
1423 min_val1 = cvReadRealByName( fs, node, "min_val1", 0. );
1424 max_val1 = cvReadRealByName( fs, node, "max_val1", 1. );
1426 tparams_node = cvGetFileNodeByName( fs, node, "training_params" );
1431 const char* tmethod_name = cvReadStringByName( fs, tparams_node, "train_method", "" );
1437 params.bp_dw_scale = cvReadRealByName( fs, tparams_node, "dw_scale", 0 );
1438 params.bp_moment_scale = cvReadRealByName( fs, tparams_node, "moment_scale", 0 );
1443 params.rp_dw0 = cvReadRealByName( fs, tparams_node, "dw0", 0 );
1444 params.rp_dw_plus = cvReadRealByName( fs, tparams_node, "dw_plus", 0 );
1445 params.rp_dw_minus = cvReadRealByName( fs, tparams_node, "dw_minus", 0 );
1446 params.rp_dw_min = cvReadRealByName( fs, tparams_node, "dw_min", 0 );
1447 params.rp_dw_max = cvReadRealByName( fs, tparams_node, "dw_max", 0 );
1450 tcrit_node = cvGetFileNodeByName( fs, tparams_node, "term_criteria" );
1453 params.term_crit.epsilon = cvReadRealByName( fs, tcrit_node, "epsilon", -1 );
1454 params.term_crit.max_iter = cvReadIntByName( fs, tcrit_node, "iterations", -1 );
1464 void CvANN_MLP::read( CvFileStorage* fs, CvFileNode* node )
1476 _layer_sizes = (CvMat*)cvReadByName( fs, node, "layer_sizes" );
1480 CV_CALL( read_params( fs, node ));
1482 w = cvGetFileNodeByName( fs, node, "input_scale" );
1487 CV_CALL( cvReadRawData( fs, w, weights[0], "d" ));
1489 w = cvGetFileNodeByName( fs, node, "output_scale" );
1494 CV_CALL( cvReadRawData( fs, w, weights[l_count], "d" ));
1496 w = cvGetFileNodeByName( fs, node, "inv_output_scale" );
1501 CV_CALL( cvReadRawData( fs, w, weights[l_count+1], "d" ));
1503 w = cvGetFileNodeByName( fs, node, "weights" );
1513 CV_CALL( cvReadRawData( fs, w, weights[i], "d" ));