Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preprocess.hpp is broken #3363

Closed
theshoonyam opened this issue Jan 20, 2023 · 3 comments
Closed

Preprocess.hpp is broken #3363

theshoonyam opened this issue Jan 20, 2023 · 3 comments

Comments

@theshoonyam
Copy link
Contributor

In mlpack/methods/preprocess.hpp, it is mentioned that there is a file preprocess.hpp inside folder preprocess, but I could not find any such file inside the aforementioned folder.

If I am wrong, then please correct me else please consider the issue.

Thanks in advance for reply.

@theshoonyam
Copy link
Contributor Author

One more thing to mention, the file mlpack.hpp does not contain the path to the below mentioned folder.

  • Linear SVM
  • nmf
  • nystroem method
  • preprocess

@AdarshSantoria
Copy link
Contributor

I agree with @Aadi-Raj but not for nmf and nystroem as their paths are indirectly included in mlpack.hpp not directly in file but on file that are included in mlpack.hpp. We can use them just by including mlpack.hpp. An example in support of my statement,

#include <mlpack.hpp>

using namespace arma;
using namespace mlpack;
using namespace mlpack::ann;
using namespace std;

int main()
{
	mat w = randu<mat>(20, 12);
	mat h = randu<mat>(12, 20);
	mat v = w * h;
	size_t r = 12;
	AMF<> nmf;
	nmf.Apply(v, r, w, h);

	for (size_t trial = 0; trial < 3; ++trial)
	{
		arma::mat data;
		data.randu(5, trial * 200);

		GaussianKernel gk;
		NystroemMethod<GaussianKernel, OrderedSelection> nm(data, gk, trial * 200);

		arma::mat g;
		nm.Apply(g);

		// Construct exact kernel matrix.
		arma::mat kernel(trial * 200, trial * 200);
		for (size_t i = 0; i < trial * 200; ++i)
		for (size_t j = 0; j < trial * 200; ++j)
			kernel(i, j) = gk.Evaluate(data.col(i), data.col(j));

		// Reconstruct approximation.
		arma::mat approximation = g * g.t();
	}
}

This code will run fine.

@rcurtin
Copy link
Member

rcurtin commented Jan 24, 2023

Thanks for the bug report! I opened #3374 which should handle the problems you pointed out. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants