verne.freenode.net changed the topic of #mlpack to: http://www.mlpack.org/ -- We don't respond instantly... but we will respond. Give it a few minutes. Or hours. -- Channel logs: http://www.mlpack.org/irc/
kris1 has quit [Quit: kris1]
kris1 has joined #mlpack
kris1 has quit [Quit: kris1]
kris1 has joined #mlpack
kris1 has quit [Quit: kris1]
kris1 has joined #mlpack
< bvr>
zoq: "lr.Train(data.t(), responses.t()); remove the transpose from the
< bvr>
second parameter." I did that, but there is a runtime error:
< bvr>
zoq: Mat::init(): requested size is not compatible with column vector layout terminate called after throwing an instance of 'std::logic_error'
partobs-mdp has joined #mlpack
kris1 has quit [Quit: kris1]
partobs-mdp has quit [Remote host closed the connection]
sumedhghaisas has quit [Ping timeout: 240 seconds]
< rcurtin>
bvr: I think you need to use 'data' not 'data.t()'
< rcurtin>
in mlpack a single point is a column, so you want to use the shape where n_points = n_cols (which I think is nontransposed)
< bvr>
rcurtin: Yeah.. I tried that too...
< bvr>
lr.Train(data, responses);
< bvr>
But the same error!
< bvr>
error: Mat::init(): requested size is not compatible with column vector layout terminate called after throwing an instance of 'std::logic_error'
< bvr>
error: Mat::init(): requested size is not compatible with column vector layout
< bvr>
terminate called after throwing an instance of 'std::logic_error'
< bvr>
< bvr>
I looked into the code for linear_regression_main.cpp, the source for cli tool mlpack_linear_regression, and found the following interesting part:
< bvr>
lr = LinearRegression(regressors, responses);
< bvr>
Timer::Stop("regression");
< bvr>
< bvr>
So effectively, I am doing the same thing, except for loading the data, which in case of cli comes from a file, and I hardcode it with a string. Do you see some inconsistencies between the two cases here:
< partobs-mdp>
zoq: I've also resolved the last compiler error - read-only "t++". (THe solution was to do this->t++) Now working on running all this stuff :)
kris1 has joined #mlpack
bvr has quit [Remote host closed the connection]
< partobs-mdp>
zoq: By the way, could you explain the difference between Evaluate() and Forward()?
< partobs-mdp>
And how do I test hamUnit.Forward(input, output);? The compiler crashes with the message: error: cannot bind ‘arma::mat {aka arma::Mat<double>}’ lvalue to ‘arma::mat&& {aka arma::Mat<double>&&}’
< partobs-mdp>
(I made it temporarily public)
< zoq>
The Evaluate function is bascially only used by the optimizer, which expects that each optimizee implements a function that takes the parameter and index of the current sample to be optimized; internally Evaluate will call the Forward function.
< zoq>
Forward takes an r-value, so you should use hamUnit.Forward(std::move(input), std::move(output)).
< partobs-mdp>
zoq: Then what's the difference between Forward and Predict?
< partobs-mdp>
By the way, I've finally found the true reason for "t++" crash - it's not OK for Attention() to be a const method
< partobs-mdp>
(At least, now everything compiles - now checking that I've got the attention mechanism right - that's where I need the "blind" SEARCH function (const 1/3)
< zoq>
Right now Forward takes a single input and returns the output, Predict can work on more than one sample, it's basically a for loop around Forward; we are working on supporting "real" batches, which would eliminate the extra function.
< zoq>
Ah, haven't looked into the fix yet, fixing such issues is often time consuming and frustrating ...
< partobs-mdp>
Attention:
< partobs-mdp>
0.1111
< partobs-mdp>
0.2222
< partobs-mdp>
0.2222
< partobs-mdp>
0.4444
< partobs-mdp>
At least this one is right :)
< zoq>
:)
bvr has joined #mlpack
< partobs-mdp>
zoq: Now the Predict phase gives some sensible values - I didn't check them yet, but at least they don't look flat-out crazy and inconsistent :)
< partobs-mdp>
Now pushing
< partobs-mdp>
zoq: Could you (independently from me - just to be 100% sure that we're doing forward pass correctly) check that the HAMUnit outputs correct values in the HAM test
vivekp has quit [Ping timeout: 255 seconds]
< partobs-mdp>
(Starting from arma::eye(4, 4) sequence and SEARCH = 1 / 3, thus giving [1/9, 2/9, 2/9, 4/9] attention at every timestep)
< bvr>
zoq: I was earlier using mlpack v2.2.2 But I downloaded and recompiled mlpack v2.2.4, and linked my program against mlpack v2.2.4. And it worked all fine. No more errors.
< bvr>
< bvr>
The output is:
< bvr>
-1.6842e-15
< bvr>
1.0000e+00
< bvr>
< bvr>
Thanks all. esp zoq, rcurtin
vivekp has joined #mlpack
< zoq>
bvr: Ah, great that you figured it out.
< zoq>
partobs-mdp: Sure, but probably not before tomorrow.
< partobs-mdp>
zoq: Ok, I'll need about the same amount of time - so thanks in advance :)