witness___ has joined #mlpack
oldbeardo has joined #mlpack
< jenkins-mlpack> Project mlpack - nightly matrix build build #447: STILL UNSTABLE in 1 hr 36 min: http://big.cc.gt.atl.ga.us:8080/job/mlpack%20-%20nightly%20matrix%20build/447/
oldbeardo has quit [Quit: Page closed]
oldbeardo has joined #mlpack
< oldbeardo> naywhayare: I noticed something that can be improved
< oldbeardo> the Load function currently does not support reading into a arma::vec object
< oldbeardo> for example if I have to load labels for training examples for a classification problem, I have to do the following
< oldbeardo> arma::mat training_labels;
< oldbeardo> arma::vec labels;
< oldbeardo> Load("training_labels.csv", train_labels);
< oldbeardo> labels = train_labels;
< oldbeardo> *arma::mat train_labels;
oldbeardo has quit [Quit: Page closed]
oldbeardo has joined #mlpack
oldbeardo has quit [Quit: Page closed]
naywhayare has joined #mlpack
oldbeardo has joined #mlpack
< naywhayare> oldbeardo: you are right about data::Load()
< naywhayare> I seem to remember originally thinking that it would work for arma::vec because arma::vec is a child class of arma::mat
< naywhayare> but I also seem to remember that I was wrong in my thinking, and that it didn't work
< oldbeardo> naywhayare: yeah, I was trying it out for my Softmax Regression implementaton
< naywhayare> but I don't remember why
< naywhayare> right now when vectors are loaded, it's usually the code that you pasted, which is somewhat inefficient
< oldbeardo> okay, I actually saw some of the code behind it
< oldbeardo> as far as I remember, it doesn't work because it is dependent on armadillo's implementation of the function
< oldbeardo> which does not support loading vectors
< naywhayare> huh, I didn't know armadillo didn't support loading vectors
< oldbeardo> that's what I remember, I maybe wrong, I had seen the data::Load() code around 20 days backs
< naywhayare> I'm running a quick test now
< oldbeardo> okay
< naywhayare> this seems to work (with armadillo 4.300):
< naywhayare> arma::vec x;
< naywhayare> x.load("file.csv");
< naywhayare> x.print("x");
< naywhayare> and I made file.csv be a five-line file with a number on each line
< naywhayare> I suppose it's possible that might fail with older versions, but I don't think the armadillo load/save code has been touched in a long time (except for the hdf5 support which I did a few weeks ago... I wonder if anyone will ever use it ?)
< oldbeardo> well, you must be knowing how the Load() function works internally, so I didn't open a ticket
< naywhayare> the data::Load() function, or Armadillo's load() function?
< naywhayare> I guess I know how both work, but I'm not sure why it doesn't load a vector
< oldbeardo> both, if the latter is relevant to the functioning of the former
< naywhayare> the data::Load() function is just sort of a wrapper around Armadillo's functionality
< naywhayare> it tries to guess the type of the file by the extension given, then tries to load it using Armadillo's load() function
< naywhayare> then it will transpose it because most data on-disk is stored row-major, but mlpack (and armadillo) use column-major data
witness___ has quit [Quit: Connection closed for inactivity]
< oldbeardo> then the data::Load() function can be made to read a row, since armadillo's load() can do it
< naywhayare> yeah, it could definitely be modified so that it worked. I'm not certain of the changes that need to be made, though
< naywhayare> I'm not sure what errors are given when you call data::Load() with an arma::vec
< naywhayare> it may be that another overload of data::Load() should be written that takes arma::Col<> objects, or something like that
< naywhayare> it seems as though vectors don't need to be transposed when loaded, if they are stored one element per line
< oldbeardo> what does this mean? : arma::Mat<eT>& matrix
< naywhayare> so arma::mat is a typedef for arma::Mat<double>
< naywhayare> matrices can be made with any type... double, int, unsigned int, float, std::complex<double>, and so forth
< naywhayare> so mlpack's data::Load() is templatized to take any element type (eT), in case the user wants to load an arma::umat or an arma::Mat<size_t> or something like that
< naywhayare> does that clarify?
< oldbeardo> yes, so that means the data::Load() function can be used only with arma::Mat variables
< naywhayare> yeah
< naywhayare> now I thought that would work with arma::vec too (where arma::vec is a typedef of arma::Col<double>)
< oldbeardo> you are right, an overload needs to be written
< naywhayare> because arma::Col is a child class of arma::Mat
< naywhayare> although it doesn't have any virtual functions
< oldbeardo> yup, doesn't seem to work
< oldbeardo> on another note, I checked out the logs, thanks for that :)
< naywhayare> the IRC logs? yeah; I still have a few bugs to work out, but they seem to be working okay
< naywhayare> it seems like irssi is not setting permissions right on new logs, so I am having to chmod +r #mlpack.${DAY}.log every morning
< naywhayare> so I need to figure that out...
< oldbeardo> okay
oldbeardo has quit [Quit: Page closed]