dims = 100;
X = cell2mat(data);
Xr = compress_seq(X, labels, dims);
rowdist = repmat([1], 1, cnt);
data = mat2cell(Xr, rowdist);

obs = cnt;

[idxTrn, idxTst] = trainingPartitions(obs, [0.8 0.2]);
XTrain = data(idxTrn);
TTrain = labels(idxTrn);

XTest = data(idxTst);
TTest = labels(idxTst);

[YTest, net] = lstm_net_1d(XTrain, TTrain, XTest)

acc = mean(YTest == TTest)
confusionchart(TTest,YTest)

