Open d12306 opened 5 years ago
Yes, 784 is the dimension of input feature.
Thanks, Sorry for another question, I am wondering the function in sampler.pl
% stroke to mask
strokes_mask([], Re, Re).
strokes_mask([[]], Re, Re).
strokes_mask([S | Ss], Temp, Masks):-
stroke_points(S, [], M),
length(M, LM),
(LM >= 8 ->
(append(Temp, [M], Temp1),
strokes_mask(Ss, Temp1, Masks), !);
(strokes_mask(Ss, Temp, Masks), !)
).
stroke_points([P], Temp, Re):-
append(Temp, [P], Re).
stroke_points([P1, P2 | Ps], Temp, Re):-
line_points(P1, P2, P),
append(Temp, P, Temp1),
stroke_points([P2 | Ps], Temp1, Re).
I am wondering the function of this code.
thanks,
Hi, this function can convert the sampled stroke points into connected line segments, which are then used for masking / removing the sampled strokes from the image.
Thanks, @haldai ,so you use
for (int j = 0; j < num_mask; j++) {
Col<double> *mask = str2ptr<Col<double>>(ms[j]);
Col<double> masked_vector = inst % *mask;
patches.push_back(masked_vector);
delete mask; // only use mask for one time, recollect memory
}
right? But I am wondering the inuition, like you should focus more on the wrong dimensions? but why you mask them out? It is hard to understand.
The masked line segments (sub-strokes) are sampled from the wrongly re-constructed examples; these "masks" are actually treated as image patches for training the sparse coder. Once a sub-stroke being masked out, the remaining part of the example image will be processed again for sampling other possible sub-strokes.
Right! Thanks
You're welcome, please feel free to ask any question about the project 😄
@haldai ,Hi, is it the org_data.n_cols = 784 or the number of samples? Since I find the armadillo library stores the matrix in a column first order.