【Intel】OpenCV総合スレ【画像処理】
■ このスレッドは過去ログ倉庫に格納されています
0302デフォルトの名無しさん
2008/01/28(月) 15:42:02CvANN_MLP mlp;
float test_input[8] = { 0.0, 0.0,
0.0, 1.0,
1.0, 0.0,
1.0, 1.0 };
float test_output[4] = { 0, 0, 0, 1 };
CvMat test_input_mat = cvMat( 2, 4, CV_32FC1, test_input );
CvMat test_output_mat = cvMat( 1, 4, CV_32FC1, test_output );
int nc[3]={ 2, 2, 1 };
CvMat NSeting = cvMat( 1, 3, CV_32SC1, nc );
mlp.create( &NSeting, CvANN_MLP::SIGMOID_SYM, 1, 1 );
mlp.train( &test_input_mat, &test_output_mat, 0, 0,
CvANN_MLP_TrainParams(
cvTermCriteria( CV_TERMCRIT_ITER | CV_TERMCRIT_EPS, 1000, 1E-100 ),
CvANN_MLP_TrainParams::RPROP, 0.05 ), 0 );
こうすると
Bad argument( input training data should be a floating-point matrix withthe number of rows equal to the number of training samples and the number of columns equal to the size of 0-th (input) layer
と出ます。
入力とNNの入力層の数が違うといわれてるらしいのですが2と2で同じだと思うし原因が分かりません。
使ったことある方教えてください。
■ このスレッドは過去ログ倉庫に格納されています