Skip to content
Snippets Groups Projects
Commit ffb98c89 authored by Vojtech Moravec's avatar Vojtech Moravec
Browse files

Removed remaining DE code.

parent dc7978ff
No related branches found
No related tags found
No related merge requests found
...@@ -14,8 +14,6 @@ import java.io.IOException; ...@@ -14,8 +14,6 @@ import java.io.IOException;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
public class ScalarQuantizationBenchmark extends BenchmarkBase { public class ScalarQuantizationBenchmark extends BenchmarkBase {
private boolean useDiffEvolution = false;
public ScalarQuantizationBenchmark(final String inputFile, public ScalarQuantizationBenchmark(final String inputFile,
final String outputDirectory, final String outputDirectory,
final int[] planes, final int[] planes,
...@@ -56,12 +54,7 @@ public class ScalarQuantizationBenchmark extends BenchmarkBase { ...@@ -56,12 +54,7 @@ public class ScalarQuantizationBenchmark extends BenchmarkBase {
System.err.println("Failed to load middle plane data."); System.err.println("Failed to load middle plane data.");
return; return;
} }
if (useDiffEvolution) { quantizer = trainLloydMaxQuantizer(middlePlaneData, codebookSize);
assert (false) : "DE is depracated";
quantizer = null;
} else {
quantizer = trainLloydMaxQuantizer(middlePlaneData, codebookSize);
}
System.out.println("Created quantizer from middle plane."); System.out.println("Created quantizer from middle plane.");
} }
...@@ -77,12 +70,7 @@ public class ScalarQuantizationBenchmark extends BenchmarkBase { ...@@ -77,12 +70,7 @@ public class ScalarQuantizationBenchmark extends BenchmarkBase {
if (!hasGeneralQuantizer) { if (!hasGeneralQuantizer) {
if (useDiffEvolution) { quantizer = trainLloydMaxQuantizer(planeData, codebookSize);
assert (false) : "DE is depracated";
quantizer = null;
} else {
quantizer = trainLloydMaxQuantizer(planeData, codebookSize);
}
System.out.println("Created plane quantizer"); System.out.println("Created plane quantizer");
} }
if (quantizer == null) { if (quantizer == null) {
...@@ -142,27 +130,4 @@ public class ScalarQuantizationBenchmark extends BenchmarkBase { ...@@ -142,27 +130,4 @@ public class ScalarQuantizationBenchmark extends BenchmarkBase {
// TODO(Moravec): FIXME // TODO(Moravec): FIXME
return new ScalarQuantizer(U16.Min, U16.Max, null);//lloydMax.getCentroids()); return new ScalarQuantizer(U16.Min, U16.Max, null);//lloydMax.getCentroids());
} }
// private ScalarQuantizer trainDifferentialEvolution(final int[] data,
// final int codebookSize) {
// ILShadeSolver ilshade = new ILShadeSolver(codebookSize, 100, 2000, 15);
// ilshade.setTrainingData(data);
//
// try {
// ilshade.train();
// } catch (DeException deEx) {
// deEx.printStackTrace();
// return null;
// }
// return new ScalarQuantizer(U16.Min, U16.Max, ilshade.getBestSolution().getAttributes());
// }
public boolean isUseDiffEvolution() {
return useDiffEvolution;
}
public void setUseDiffEvolution(boolean useDiffEvolution) {
this.useDiffEvolution = useDiffEvolution;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment