- added rms_error function
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@786 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+2
-6
@@ -182,9 +182,7 @@ void Rbm::train(IListener* pListener)
|
||||
lastProgress = status.progress;
|
||||
|
||||
// Calculate error
|
||||
arma::mat diffErr = miniBatch - prob(h_to_v(prob(v_to_h(v_states))));
|
||||
arma::mat diffErr_squared = diffErr % diffErr;
|
||||
status.err = accu(diffErr_squared)/diffErr_squared.n_elem;
|
||||
status.err = rms_error_accu(miniBatch - prob(h_to_v(prob(v_to_h(v_states)))));
|
||||
if (pListener)
|
||||
{
|
||||
if(!pListener->onProgress(this, status))
|
||||
@@ -200,9 +198,7 @@ void Rbm::train(IListener* pListener)
|
||||
} // number of mini batches
|
||||
|
||||
// Update final status
|
||||
arma::mat diffErr = batch - prob(h_to_v(prob(v_to_h(batch))));
|
||||
arma::mat diffErr_squared = diffErr % diffErr;
|
||||
status.err_total = accu(diffErr_squared)/diffErr_squared.n_elem;
|
||||
status.err_total = rms_error_accu(batch - prob(h_to_v(prob(v_to_h(batch)))));
|
||||
|
||||
if (pListener)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user