rcurtin_irc changed the topic of #mlpack to: mlpack: a scalable machine learning library (https://www.mlpack.org/) -- channel logs: https://libera.irclog.whitequark.org/mlpack -- NOTE: messages sent here might not be seen by bridged users on matrix, gitter, or slack
ShubhamAgrawal[m has joined #mlpack
jonpsy[m] has joined #mlpack
IWNWME has joined #mlpack
IWNWME has quit [Quit: Client closed]
<akhunti1[m]> Hi All ,
<akhunti1[m]> if you see line number 72 , classify method i am passing json_str as a test data for inferencing , instead of passing testdataset .
<akhunti1[m]> because i need to pass test data from curl api like this : curl --http0.9 -X POST -H 'Content-Type: application/json' -d'{"data": { "ndarray": [[1,2,3,4,5,6]]}}' http://localhost:9000/api/v1.0/predictions for inferencing .
<akhunti1[m]> but it is throwing me error .
<akhunti1[m]> could you please suggest me what changes should i do , for this .
<akhunti1[m]> This is the error message i got . As my requirement is i need to pass from curl command for inferencing like this [ curl --http0.9 -X POST -H 'Content-Type: application/json' -d'{"data": { "ndarray": [[1,2,3,4,5,6]]}}' http://localhost:9000/api/v1.0/predictions ] ,
<akhunti1[m]> so i cannot hard coard test data set like line number 64 .
<rcurtin[m]> so the data comes as a string? like the string [[1, 2, 3, 4, 5, 6]] represents the data?
<akhunti1[m]> yes rcurtin
<rcurtin[m]> ahh, you will need to parse it then. it could be a little tedious, but I suggest a two-pass approach, where in the first pass you compute the size of the matrix, and then you create an arma::mat of the required size, and then in the second pass you fill it
<rcurtin[m]> you could consider using C++'s istringstream to parse the input, or maybe strtok(). I don't have any code samples handy, it could be a little tedious to do, but that is what you'll have to do
<rcurtin[m]> or... wait a second, I know that Armadillo has a string constructor. I am not sure if it will work exactly but you could try arma::mat(data) to see if it works
<rcurtin[m]> check out the section on the mat(string) constructor. you will probably have to do some reformatting of the string that you get as input, but that would likely be a lot easier
<akhunti1[m]> Hi rcurtin Thanks [ arma::mat(data) ] this line solved the problem .
<rcurtin[m]> make sure to double check that it is actually parsing the data correctly; it would be easy for that constructor to actually fail and, e.g., produce an empty matrix 👍️
<vaibhavp[m]> rcurtin: Hi! If you have time can you please look at the demo for DAGNetwork API and share your thoughts on it? Code for DAGNetwork class is the same repo. It's still a little rough but gives the overview. I would be very grateful. [ResNet_Example](https://github.com/mrdaybird/mlpack-dag-network/blob/main/ResNet_Example.cpp)
<akhunti1[m]> Hi rcurtin
<akhunti1[m]> i got the out put like this
<vaibhavp[m]> akhunti1: You can also try to print the data matrix(from arma::mat(string) to check that if it is the correct matrix or not.
<akhunti1[m]> sure , Thanks vaibhavp
lxi has joined #mlpack
lxi_ has joined #mlpack
lxi has quit [Ping timeout: 260 seconds]
DavidValenteGSoC has joined #mlpack
DavidValenteGSoC has quit [Client Quit]
DavidValenteGSoC has joined #mlpack
<DavidValenteGSoC> Hello, my name id David Valente, I´m in my 3rd year of CSE at IST Lisbon and I´m interested in contributing to the algorithm optimization project for GSoC. Are there any recommended issues I could help to get started with? Thanks
DavidValenteGSoC has quit [Ping timeout: 260 seconds]