Skip to content

Instantly share code, notes, and snippets.

View manish7294's full-sized avatar

Manish Kumar manish7294

View GitHub Profile
@manish7294
manish7294 / covertype-5k_simulation.txt
Created July 11, 2018 14:39
Impostor Bounds Simulations
$ bin/mlpack_lmnn -i covertype-5k.csv -l covertype-5k.labels.csv -k 5 -o output.csv -P true -O lbfgs -v -n 50| grep -v 'node combinations\|base cases'
[DEBUG] Compiled with debugging symbols.
[INFO ] Loading 'covertype-5k.csv' as CSV data. Size is 54 x 5000.
[INFO ] Loading 'covertype-5k.labels.csv' as raw ASCII formatted data. Size is 5000 x 1.
[INFO ] Initial learning point have invalid dimensionality. Identity matrix will be used as initial learning point for optimization.
Iteration - 0 : Out of 5000, Impostors were recalculated for 5000 points. transformationDiff : 0
[DEBUG] L-BFGS iteration 0; objective 3.09637e+06, gradient norm 8.1396e+08, 0.
Iteration - 1 : Out of 5000, Impostors were recalculated for 5000 points. transformationDiff : 0.697094
[DEBUG] L-BFGS iteration 1; objective 1.93411e+06, gradient norm 3.23659e+08, 0.375363.
Iteration - 2 : Out of 5000, Impostors were recalculated for 5000 points. transformationDiff : 0.47624
@manish7294
manish7294 / distance_correctness.txt
Last active July 14, 2018 08:58
Check for correctness
LBFGS -
IRIS - WITH CHANGES
1.6498 0.0695 -0.0498 -0.2692
0.0888 1.2758 -0.2269 -0.0435
-0.1993 -0.4028 2.0772 1.0803
-0.3799 -0.1621 0.9357 1.9584
IRIS - WITHOUT CHANGES
1.6498 0.0695 -0.0498 -0.2692
0.0888 1.2758 -0.2269 -0.0435
$ bin/mlpack_lmnn -i covertype-5k.csv -l covertype-5k.labels.csv -o output.csv -P -O lbfgs -v | grep -v 'node combinations\|base cases\|DEBUG' 2>&1
...
Evaluate(): 0 pruned of 5000, transformation diff 0.00879516. Active: 2989, close 1944, inactive 67.
Evaluate(): 0 pruned of 5000, transformation diff 0.00713265. Active: 2886, close 2027, inactive 87.
Evaluate(): 0 pruned of 5000, transformation diff 0.00356632. Active: 2941, close 1983, inactive 76.
Evaluate(): 0 pruned of 5000, transformation diff 0.00178316. Active: 2968, close 1961, inactive 71.
Evaluate(): 0 pruned of 5000, transformation diff 0.000891581. Active: 2977, close 1955, inactive 68.
Evaluate(): 5 pruned of 5000, transformation diff 0.00044579. Active: 2980, close 1952, inactive 68.
Evaluate(): 67 pruned of 5000, transformation diff 0.000222895. Active: 2983, close 1956, inactive 61.
Evaluate(): 424 pruned of 5000, transformation diff 0.000111448. Active: 2987, close 1971, inactive 42.
Evaluate(): 0 pruned of 12013 transformation diff 0. Active: 10733 close 1150 inactive 130.
Evaluate(): 0 pruned of 10427 transformation diff 0.918681. Active: 8984 close 868 inactive 575.
Evaluate(): 0 pruned of 10029 transformation diff 0.211762. Active: 8421 close 911 inactive 697.
Evaluate(): 155 pruned of 10369 transformation diff 0.105881. Active: 8906 close 878 inactive 585.
Evaluate(): 373 pruned of 10426 transformation diff 0.0529405. Active: 8980 close 1102 inactive 344.
Evaluate(): 633 pruned of 10426 transformation diff 0.0264703. Active: 8981 close 1124 inactive 321.
Evaluate(): 671 pruned of 10427 transformation diff 0.0132351. Active: 8983 close 934 inactive 510.
Evaluate(): 1049 pruned of 10427 transformation diff 0.00661757. Active: 8983 close 1007 inactive 437.
Evaluate(): 1191 pruned of 10427 transformation diff 0.00330878. Active: 8984 close 1024 inactive 419.
Evaluate(): 1287 pruned of 10427 transformation diff 0.00165439. Active: 8984 close 1035 in
double innerProduct(arma::mat& Ar, arma::mat& Z)
{
double sum = 0.0;
for (size_t i = 0; i < Z.n_elem; i++)
sum += Ar(i) * Z(i);
return sum;
}
% File Type: Matlab
% Author: Junae Kim {junae.kim@gmail.com},
% Chunhua Shen {chhshen@gmail.com}
% Creation Tuesday 26/02/2009 19:56.
% Last Revision: Friday 06/03/2009 10:40.
%
% Input : trn, training data
% [ dim, num ] = size(trn.X),
% trn.y is the labels
% varargin, parameters
max Iterations : 500
Iris:
k Initial Final Timings Final_LMNN Timings_LMNN Final_LMNN_NoImp Timings_LMNN_NoImp
1 95.333 96.667 0.246141 96.000 0.305383 96.6667 0.053881
2 95.333 96.667 0.055891 96.000 0.460756 96.00 0.093379
5 98.000 95.333 1.662990 96.667 0.808036 96.6667 0.261077
10 95.3333 96.667 0.520501 97.3333 1.487357 97.3333 0.740489
vc2:
Iris:
k Accuracy Timings Accuracy_Master Timings_Master
5 96.6667 0.483215 96.6667 0.899712
10 97.3333 1.091467 97.3333 1.547372
vc2:
k Accuracy Timings Accuracy_Master Timings_Master
5 77.7778 1.971792 77.7778 3.158439
10 81.6425 4.913914 81.6425 6.171987
Iris:
k Accuracy Timings Accuracy_Master Timings_Master
5 96.6667 0.875329 96.6667 0.899712
10 97.3333 1.681192 97.3333 1.547372
vc2:
k Accuracy Timings Accuracy_Master Timings_Master
5 77.7778 3.390961 77.7778 3.158439
10 81.6425 6.613346 81.6425 6.171987
bin/mlpack_lmnn -i covertype.txt -n 20 -k 1 -O lbfgs -v | grep -v 'node combinations\|base cases\|DEBUG'
[WARN ] Should pass '--output_file (-o)'; no output will be saved!
[INFO ] Loading 'covertype.txt' as CSV data. Size is 55 x 581012.
[INFO ] Using last column of input dataset as labels.
[INFO ] Initial learning point have invalid dimensionality. Identity matrix will be used as initial learning point for optimization.
Iteraion 2 : Out of 581012, Impostors will be recalculated for 581012 data points. transformationDiff : 0.582531
Iteraion 3 : Out of 581012, Impostors will be recalculated for 581012 data points.transformationDiff : 0.519489
Iteraion 4 : Out of 581012, Impostors will be recalculated for 581012 data points.transformationDiff : 1.28358
Iteraion 5 : Out of 581012, Impostors will be recalculated for 581012 data points.transformationDiff : 0.641792
Iteraion 6 : Out of 581012, Impostors will be recalculated for 581012 data points.transformationDiff : 0.320896