Home | History | Annotate | Download | only in src

Lines Matching refs:weights

297         // 3) Update weights by the gradient descent
635 CvMat* connect_mask, CvMat* weights )
656 CV_CALL(layer->weights = cvCreateMat( n_output_planes, K*K+1, CV_32FC1 ));
659 if( weights )
661 if( !ICV_IS_MAT_OF_TYPE( weights, CV_32FC1 ) )
662 CV_ERROR( CV_StsBadSize, "Type of initial weights matrix must be CV_32FC1" );
663 if( !CV_ARE_SIZES_EQ( weights, layer->weights ) )
664 CV_ERROR( CV_StsBadSize, "Invalid size of initial weights matrix" );
665 CV_CALL(cvCopy( weights, layer->weights ));
670 cvRandArr( &rng, layer->weights, CV_RAND_UNI, cvRealScalar(-1), cvRealScalar(1) );
688 cvReleaseMat( &layer->weights );
700 float init_learn_rate, int learn_rate_decrease_type, CvMat* weights )
733 CV_CALL(layer->weights = cvCreateMat( n_output_planes, 2, CV_32FC1 ));
734 if( weights )
736 if( !ICV_IS_MAT_OF_TYPE( weights, CV_32FC1 ) )
737 CV_ERROR( CV_StsBadSize, "Type of initial weights matrix must be CV_32FC1" );
738 if( !CV_ARE_SIZES_EQ( weights, layer->weights ) )
739 CV_ERROR( CV_StsBadSize, "Invalid size of initial weights matrix" );
740 CV_CALL(cvCopy( weights, layer->weights ));
745 cvRandArr( &rng, layer->weights, CV_RAND_UNI, cvRealScalar(-1), cvRealScalar(1) );
762 float init_learn_rate, int learn_rate_decrease_type, CvMat* weights )
783 CV_CALL(layer->weights = cvCreateMat( n_outputs, n_inputs+1, CV_32FC1 ));
784 if( weights )
786 if( !ICV_IS_MAT_OF_TYPE( weights, CV_32FC1 ) )
787 CV_ERROR( CV_StsBadSize, "Type of initial weights matrix must be CV_32FC1" );
788 if( !CV_ARE_SIZES_EQ( weights, layer->weights ) )
789 CV_ERROR( CV_StsBadSize, "Invalid size of initial weights matrix" );
790 CV_CALL(cvCopy( weights, layer->weights ));
795 cvRandArr( &rng, layer->weights, CV_RAND_UNI, cvRealScalar(-1), cvRealScalar(1) );
803 cvReleaseMat( &layer->weights );
851 w = layer->weights->data.fl;
933 w = layer->weights->data.fl;
975 CvMat* weights = layer->weights;
981 CV_CALL(cvGetSubRect( weights, &sub_weights,
982 cvRect(0, 0, weights->cols-1, weights->rows )));
983 CV_CALL(cvGetCol( weights, &bias, weights->cols-1));
1053 CvMat* weights = layer->weights;
1056 CV_ASSERT( n_Y_planes == weights->rows );
1059 dY_dW = cvCreateMat( dY_dX->rows, weights->cols*weights->rows, CV_32FC1 );
1068 w = weights->data.fl + no*(K*K+1);
1105 // update weights
1115 cvReshape( dE_dW, &dE_dW_mat, 0, weights->rows );
1116 cvScaleAdd( &dE_dW_mat, cvRealScalar(eta), weights, weights );
1193 // compute <dY_dX> = layer->weights*<dY_dX>
1194 w = layer->weights->data.fl;
1220 // update weights
1222 CvMat dE_dW_mat, *weights = layer->weights;
1230 cvReshape( dE_dW, &dE_dW_mat, 0, weights->rows );
1231 cvScaleAdd( &dE_dW_mat, cvRealScalar(eta), weights, weights );
1245 of the previous layer (X) and the weights of the current layer (W)
1246 and updates weights od the current layer by using <dE_dW>.
1273 CvMat* weights = layer->weights;
1283 CV_CALL(dE_dW = cvCreateMat( 1, weights->rows*weights->cols, CV_32FC1 ));
1295 CV_CALL(cvGetSubRect( weights, &sub_weights,
1296 cvRect(0, 0, weights->cols-1, weights->rows) ));
1308 // 2) update weights
1319 cvScaleAdd( &dE_dW_mat, cvRealScalar(eta), weights, weights );
1348 cvReleaseMat( &layer->weights );
1374 cvReleaseMat( &layer->weights );
1399 cvReleaseMat( &layer->weights );
1432 CvMat* weights = 0;
1453 CV_CALL(weights = (CvMat*)cvReadByName( fs, node, "weights" ));
1457 init_learn_rate < 0 || learn_type < 0 || layer_type < 0 || !weights )
1472 init_learn_rate, learn_type, connect_mask, weights ));
1489 a, s, init_learn_rate, learn_type, weights ));
1503 a, s, init_learn_rate, learn_type, weights ));
1513 cvReleaseMat( &weights );
1538 CV_CALL(cvWrite( fs, "weights", layer->weights ));