All Articles

Experience: Week Six

mlpack-logo.png gsoc-logo.png

So last week I was facing an error reading the overloads of the Load() where basically it was ambiguous of the compiler to decide which overload to pick while loading data in the matrix(only-numeric data). I think I should have mentioned this in the previous blogs maybe but mlpack basically has many overloads of Load() which loads different formats of data into their corresponding data-structure. Just to name some

  • Load in a matrix, only numeric data
  • Load in a matrix with DatasetMapper, non-numeric data
  • Load in sparse matrix
  • Load image
  • Load a model
  • Load in a row vector
  • Load in a column vector

We have great many to explore in mlpack. So currently the issue was with loading of sparse matrix. For now we decided to comment that defination so that we can focus on the parser. Also we can handle that case easily.

So now the tests were running successfully. But obviously they were failing. The file which tests the loading and saving of data in mlpack/src/mlpack/tests/load_save_test.cpp. After successfully handling all the fail cases it was time to move to last two fucntions which uses boost::spirit.

The current implemntation basically had a lambda fucntion combined with boost::parse to identify the delimiter and parse the line accordingly and at the end of parsing update the DatasetMapper.

In these tasks I am spending more time in testing rather than writing the code itself as we can have a large number of cases for parser and thanks to already well implemented tests in mlpack I have a basic goal of passing all the current test cases and then think about if we need new tests based on our new implementation.