@Test public void testAllEqual() { final Equilateral eq = new Equilateral(10, -1, 1); final CalculateDistance dc = new EuclideanDistance(); double compareDist = 0; for (int x = 0; x < 10; x++) { double[] baseClass = eq.encode(x); for (int y = 0; y < 10; y++) { if (x != y) { double[] otherClass = eq.encode(y); double dist = dc.calculate(baseClass, otherClass); if (compareDist < AIFH.DEFAULT_PRECISION) { compareDist = dist; } else { assertEquals(compareDist, dist, AIFH.DEFAULT_PRECISION); } } } } }
public final double[] encode(final int set) { if (set < 0 || set > this.matrix.length) { throw new AIFHError("Class out of range for equilateral: " + set); } return this.matrix[set]; }
Equilateral implements Serializable { public final double[] encode(final int set) { if (set < 0 || set > this.matrix.length) { throw new AIFHError("Class out of range for equilateral: " + set); } return this.matrix[set]; } }
Equilateral implements Serializable { public final double[] encode(final int set) { if (set < 0 || set > this.matrix.length) { throw new AIFHError("Class out of range for equilateral: " + set); } return this.matrix[set]; } Equilateral(final int count, final double low, final double high); }
Equilateral implements Serializable { public final double[] encode(final int set) { if (set < 0 || set > this.matrix.length) { throw new AIFHError("Class out of range for equilateral: " + set); } return this.matrix[set]; } Equilateral(final int count, final double low, final double high); final int decode(final double[] activations); final double[] encode(final int set); final double getDistance(final double[] data, final int set); }
Equilateral implements Serializable { public final double[] encode(final int set) { if (set < 0 || set > this.matrix.length) { throw new AIFHError("Class out of range for equilateral: " + set); } return this.matrix[set]; } Equilateral(final int count, final double low, final double high); final int decode(final double[] activations); final double[] encode(final int set); final double getDistance(final double[] data, final int set); static final int MIN_EQ; }