Skip to content
Snippets Groups Projects
Commit 64079773 authored by Jakhes's avatar Jakhes
Browse files

Adding nca tests

parent b79560c3
Branches
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
%% %%
%% Then perform nca on the given data and return the learned distance. %% Then perform nca on the given data and return the learned distance.
%% %%
nca(OptimizerType, StepSize, MaxIterations, Tolerance, Shuffle, NumBasis, ArmijoConstant, Wolfe, MaxLine, MinStep, MaxStept, BatchSize, nca(OptimizerType, StepSize, MaxIterations, Tolerance, Shuffle, NumBasis, ArmijoConstant, Wolfe, MaxLine, MinStep, MaxStep, BatchSize,
DataList, DataRows, PredictionList, DistanceList, ZCols) :- DataList, DataRows, PredictionList, DistanceList, ZCols) :-
StepSize > 0, StepSize > 0,
MaxIterations >= 0, MaxIterations >= 0,
...@@ -48,14 +48,14 @@ nca(OptimizerType, StepSize, MaxIterations, Tolerance, Shuffle, NumBasis, Armijo ...@@ -48,14 +48,14 @@ nca(OptimizerType, StepSize, MaxIterations, Tolerance, Shuffle, NumBasis, Armijo
NumBasis > 0, NumBasis > 0,
ArmijoConstant > 0, ArmijoConstant > 0,
Wolfe > 0, Wolfe > 0,
MaxLineSearchTrials > 0, MaxLine > 0,
MinStep > 0, MinStep > 0,
MaxStep > 0, MaxStep > 0,
MaxStep >= MinStep, MaxStep >= MinStep,
BatchSize > 0, BatchSize > 0,
convert_list_to_float_array(DataList, DataRows, array(Xsize, Xrows, X)), convert_list_to_float_array(DataList, DataRows, array(Xsize, Xrows, X)),
convert_list_to_float_array(PredictionList, array(Ysize, Y)), convert_list_to_float_array(PredictionList, array(Ysize, Y)),
ncaI(OptimizerType, StepSize, MaxIterations, Tolerance, Shuffle, NumBasis, ArmijoConstant, Wolfe, MaxLine, MinStep, MaxStept, BatchSize, ncaI(OptimizerType, StepSize, MaxIterations, Tolerance, Shuffle, NumBasis, ArmijoConstant, Wolfe, MaxLine, MinStep, MaxStep, BatchSize,
X, Xsize, Xrows, Y, Ysize, Z, ZCols, ZRows), X, Xsize, Xrows, Y, Ysize, Z, ZCols, ZRows),
convert_float_array_to_2d_list(Z, ZCols, ZRows, DistanceList). convert_float_array_to_2d_list(Z, ZCols, ZRows, DistanceList).
......
...@@ -49,13 +49,13 @@ test(nca_Negative_BatchSize, fail) :- ...@@ -49,13 +49,13 @@ test(nca_Negative_BatchSize, fail) :-
test(nca_Too_Short_Label, [error(_,system_error('Error'))]) :- test(nca_Too_Short_Label, [error(_,system_error('Error'))]) :-
nca(lbfgs, 0.01, 500000, 0.00001, 1, 5, 0.0001, 0.9, 50, 0.000000001, 100000000, 50, [5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,1], _, _) nca(lbfgs, 0.01, 500000, 0.00001, 1, 5, 0.0001, 0.9, 50, 0.000000001, 100000000, 50, [5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,1], _, _).
test(nca_Too_Long_Label, [error(_,system_error('Error'))]) :- test(nca_Too_Long_Label, [error(_,system_error('Error'))]) :-
nca(lbfgs, 0.01, 500000, 0.00001, 1, 5, 0.0001, 0.9, 50, 0.000000001, 100000000, 50, [5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,1,0,1,0,1], _, _) nca(lbfgs, 0.01, 500000, 0.00001, 1, 5, 0.0001, 0.9, 50, 0.000000001, 100000000, 50, [5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,1,0,1,0,1], _, _).
test(nca_Too_Many_Label_Classes, [error(_,system_error('Error'))]) :- test(nca_Too_Many_Label_Classes, [error(_,system_error('Error'))]) :-
nca(lbfgs, 0.01, 500000, 0.00001, 1, 5, 0.0001, 0.9, 50, 0.000000001, 100000000, 50, [5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,1,2,3], _, _) nca(lbfgs, 0.01, 500000, 0.00001, 1, 5, 0.0001, 0.9, 50, 0.000000001, 100000000, 50, [5.1,3.5,1.4,4.9,3.0,1.4,4.7,3.2,1.3,4.6,3.1,1.5], 3, [0,1,2,3], _, _).
%% Successful Tests %% Successful Tests
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment