- removed unused code
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@793 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -29,50 +29,6 @@ class RbmListener : public Rbm::IListener
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
arma::mat loadTraining(const string &filename)
|
|
||||||
{
|
|
||||||
uint32_t numTraining = 0;
|
|
||||||
uint32_t numVisible = 0;
|
|
||||||
FILE *pFile;
|
|
||||||
|
|
||||||
pFile = fopen(filename.c_str(), "r");
|
|
||||||
|
|
||||||
if (!pFile)
|
|
||||||
{
|
|
||||||
std::cout << "Could not open " << filename << "!" << std::endl;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int result = fscanf(pFile, "%d\n", &numTraining);
|
|
||||||
if (result < 0)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
result = fscanf(pFile, "%d\n", &numVisible);
|
|
||||||
if (result < 0)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
arma::mat data = arma::zeros(numTraining, numVisible);
|
|
||||||
|
|
||||||
uint32_t i, j;
|
|
||||||
for (i=0; i < numTraining; i++)
|
|
||||||
{
|
|
||||||
for (j=0; j < numVisible; j++)
|
|
||||||
{
|
|
||||||
float v;
|
|
||||||
int result = fscanf(pFile, "%f", &v);
|
|
||||||
if (result > 0)
|
|
||||||
{
|
|
||||||
data(i, j) = v;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fclose(pFile);
|
|
||||||
return data;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
printf("Hallo, Welt!\n");
|
printf("Hallo, Welt!\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user