Java Array Max Value maxpool(float[] curr, float[] probs)

Here you can find the source of maxpool(float[] curr, float[] probs)

Description

Takes the maximum value at each position

License

Open Source License

Declaration

public static float[] maxpool(float[] curr, float[] probs) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//  w  ww  .jav a2  s  . c  o m
     * Takes the maximum value at each position
     */
    public static float[] maxpool(float[] curr, float[] probs) {
        if (curr.length != probs.length) {
            throw new IllegalArgumentException("Float[] need to have the same size");
        }
        float[] _ret = new float[curr.length];
        for (int i = 0; i < curr.length; i++) {
            if (curr[i] > probs[i]) {
                _ret[i] = curr[i];
            } else {
                _ret[i] = probs[i];
            }
        }
        return _ret;
    }
}

Related

  1. maxNorm(double[] x1, double[] x2)
  2. maxNormWithAbort(double[] x1, double[] x2, double limit)
  3. maxNum(Number iArr[])
  4. maxOfSortedValues(double[] sortedValues)
  5. maxOverArraySubset(double[] array, Iterable subset)
  6. maxPosition(float[] v)
  7. maxPositive(int[] array)
  8. maxPrim(final int... numbers)
  9. maxRepeating(int[] input, int k)