@Override public DoubleFV newInstance() { return new DoubleFV(length()); } }
@Override public DoubleFV newInstance() { return new DoubleFV(length()); } }
/** * Compute the Homogeneous Kernel Map approximation of the given feature vector * * @param in * the feature vector * @return the expanded feature vector */ public DoubleFV evaluate(DoubleFV in) { final int step = (2 * order + 1); final DoubleFV out = new DoubleFV(step * in.length()); for (int i = 0; i < in.length(); i++) { evaluate(out.values, 1, i * step, in.values[i]); } return out; }
private void drawHistogramImage(DoubleFV histogram) { histogram = histogram.normaliseFV(); final int width = this.histogramImage.getWidth(); final int height = this.histogramImage.getHeight(); final int bw = width / histogram.length(); this.histogramImage.zero(); final MBFImageRenderer renderer = this.histogramImage.createRenderer(); final Rectangle s = new Rectangle(); s.width = bw; for (int i = 0; i < histogram.values.length; i++) { final int rectHeight = (int) (histogram.values[i] * height); final int remHeight = height - rectHeight; s.x = i * bw; s.y = remHeight; s.height = rectHeight; renderer.drawShapeFilled(s, this.mode.colourForBin(i)); } }
private void drawHistogramImage(DoubleFV histogram) { histogram = histogram.normaliseFV(); final int width = this.histogramImage.getWidth(); final int height = this.histogramImage.getHeight(); final int bw = width / histogram.length(); this.histogramImage.zero(); final MBFImageRenderer renderer = this.histogramImage.createRenderer(); final Rectangle s = new Rectangle(); s.width = bw; for (int i = 0; i < histogram.values.length; i++) { final int rectHeight = (int) (histogram.values[i] * height); final int remHeight = height - rectHeight; s.x = i * bw; s.y = remHeight; s.height = rectHeight; renderer.drawShapeFilled(s, this.mode.colourForBin(i)); } }