Exemplo n.º 1
0
void HMM::setEmissionPropability(array1D mean, array1D std){
	assert(mean.size() >= this->stateCount);
	assert(std.size() >= this->stateCount);
	for (unsigned int i = 0; i < this->stateCount; i += 1){
		this->setEmissionPropability(mean[i], std[i], i);
	}
}
Exemplo n.º 2
0
double hiddenMarkovModel::normaliseArray(array1D &arr){
	double sum = 0;
	for (unsigned int i = 0, end = arr.size(); i < end; i += 1){
		sum += arr[i];
	}
	rescaleArray(arr, sum);
	return sum;
};
Exemplo n.º 3
0
void hiddenMarkovModel::rescaleArray(array1D &arr, double factor){
	for (unsigned int i = 0, end = arr.size(); i < end; i += 1){
		arr[i] /= factor;
	}
};