Fixes from @rcurtin's review

This commit is contained in:
Konstantin Sidorov
2017-07-31 12:44:16 +03:00
parent 16d3bfbcc1
commit 3f0e2feccd
3 changed files with 10 additions and 4 deletions
@@ -26,8 +26,9 @@ namespace tasks /* Task utilities for augmented */ {
* The parameters are:
* - macimum binary length;
*
* Every element of sequence is encoded as 3-dimensional vector
* (one-hot vector for elements {0, 1, +}).
* Every element of sequence is encoded as 1-dimensional vector
* (possible vector elements are {0, 1, 0.5} -
* the latter corresponds to '+' sign').
* Generated datasets are compliant with mlpack format -
* every dataset element is shaped as a vector of
* length 3 * (sequence length),
@@ -54,6 +54,9 @@ const void AddTask::Generate(arma::field<arma::mat>& input,
input(i) = arma::randi<arma::mat>(sizeA + sizeB + 1,
1,
arma::distr_param(0, 1));
// Adding leading 1 to make the distribution over numbers uniform.
input(i).at(sizeA - 1, 0) = 1;
input(i).at(sizeA + sizeB, 0) = 1;
// Insert special value for '+' delimiter.
labels(i) = arma::zeros(sizeA + sizeB + 1, 1);
input(i).at(sizeA, 0) = 0.5;
@@ -32,8 +32,10 @@ namespace tasks /* Task utilities for augmented */ {
* length (binary length) * (sequence length).
*
* Example of generated dataset (sequence length = 3, binary length = 2):
* - Input sequences: [ [1,1,0,0,0,1], [0,0,0,0,1,1] ]
* - Output sequences: [ [0,0,0,1,1,1], [0,0,0,0,1,1] ]
* - Input sequences: [1,1,0,0,0,1]
* (three numbers in the sequence are 11, 00, and 01)
* - Output sequences: [0,0,0,1,1,1]
* (00, 01, 11 - reordering of the numbers above in the ascending order)
*
*/
class SortTask