int columns = r.getColumnDimension(); int rank = 1; double lastNorm = r.getFrobeniusNorm(); double rNorm = lastNorm; while (rank < FastMath.min(rows, columns)) { double thisNorm = r.getSubMatrix(rank, rows - 1, rank, columns - 1).getFrobeniusNorm(); if (thisNorm == 0 || (thisNorm / lastNorm) * rNorm < dropThreshold) { break;
/** * Update of the evolution paths ps and pc. * * @param zmean Weighted row matrix of the gaussian random numbers generating * the current offspring. * @param xold xmean matrix of the previous generation. * @return hsig flag indicating a small correction. */ private boolean updateEvolutionPaths(RealMatrix zmean, RealMatrix xold) { ps = ps.scalarMultiply(1 - cs).add( B.multiply(zmean).scalarMultiply(FastMath.sqrt(cs * (2 - cs) * mueff))); normps = ps.getFrobeniusNorm(); final boolean hsig = normps / FastMath.sqrt(1 - FastMath.pow(1 - cs, 2 * iterations)) / chiN < 1.4 + 2 / ((double) dimension + 1); pc = pc.scalarMultiply(1 - cc); if (hsig) { pc = pc.add(xmean.subtract(xold).scalarMultiply(FastMath.sqrt(cc * (2 - cc) * mueff) / sigma)); } return hsig; }
/** * Update of the evolution paths ps and pc. * * @param zmean Weighted row matrix of the gaussian random numbers generating * the current offspring. * @param xold xmean matrix of the previous generation. * @return hsig flag indicating a small correction. */ private boolean updateEvolutionPaths(RealMatrix zmean, RealMatrix xold) { ps = ps.scalarMultiply(1 - cs).add( B.multiply(zmean).scalarMultiply( FastMath.sqrt(cs * (2 - cs) * mueff))); normps = ps.getFrobeniusNorm(); final boolean hsig = normps / FastMath.sqrt(1 - FastMath.pow(1 - cs, 2 * iterations)) / chiN < 1.4 + 2 / ((double) dimension + 1); pc = pc.scalarMultiply(1 - cc); if (hsig) { pc = pc.add(xmean.subtract(xold).scalarMultiply(FastMath.sqrt(cc * (2 - cc) * mueff) / sigma)); } return hsig; }
pc = zeros(dimension, 1); // evolution paths for C and sigma ps = zeros(dimension, 1); // B defines the coordinate system normps = ps.getFrobeniusNorm();
pc = zeros(dimension, 1); // evolution paths for C and sigma ps = zeros(dimension, 1); // B defines the coordinate system normps = ps.getFrobeniusNorm();
private double computeE() { E = X.subtract(L).subtract(S); double norm = E.getFrobeniusNorm(); return Math.pow(norm, 2); }
private double computeE() { E = X.subtract(L).subtract(S); double norm = E.getFrobeniusNorm(); return Math.pow(norm, 2); }
private double computeE() { E = X.subtract(L).subtract(S); double norm = E.getFrobeniusNorm(); return Math.pow(norm, 2); }
private double computeE() { E = X.subtract(L).subtract(S); double norm = E.getFrobeniusNorm(); return Math.pow(norm, 2); }
int columns = r.getColumnDimension(); int rank = 1; double lastNorm = r.getFrobeniusNorm(); double rNorm = lastNorm; while (rank < Math.min(rows, columns)) { double thisNorm = r.getSubMatrix(rank, rows - 1, rank, columns - 1).getFrobeniusNorm(); if (thisNorm == 0 || (thisNorm / lastNorm) * rNorm < dropThreshold) { break;
int columns = r.getColumnDimension(); int rank = 1; double lastNorm = r.getFrobeniusNorm(); double rNorm = lastNorm; while (rank < FastMath.min(rows, columns)) { double thisNorm = r.getSubMatrix(rank, rows - 1, rank, columns - 1).getFrobeniusNorm(); if (thisNorm == 0 || (thisNorm / lastNorm) * rNorm < dropThreshold) { break;
/** * Update of the evolution paths ps and pc. * * @param zmean Weighted row matrix of the gaussian random numbers generating * the current offspring. * @param xold xmean matrix of the previous generation. * @return hsig flag indicating a small correction. */ private boolean updateEvolutionPaths(RealMatrix zmean, RealMatrix xold) { ps = ps.scalarMultiply(1 - cs).add( B.multiply(zmean).scalarMultiply( Math.sqrt(cs * (2 - cs) * mueff))); normps = ps.getFrobeniusNorm(); final boolean hsig = normps / Math.sqrt(1 - Math.pow(1 - cs, 2 * iterations)) / chiN < 1.4 + 2 / ((double) dimension + 1); pc = pc.scalarMultiply(1 - cc); if (hsig) { pc = pc.add(xmean.subtract(xold).scalarMultiply(Math.sqrt(cc * (2 - cc) * mueff) / sigma)); } return hsig; }
private void computeRSVD() { double mu = X.getColumnDimension() * X.getRowDimension() / (4 * l1norm(X.getData())); double objPrev = 0.5*Math.pow(X.getFrobeniusNorm(), 2); double obj = objPrev; double tol = 1e-8 * objPrev; double diff = 2 * tol; int iter = 0; while(diff > tol && iter < MAX_ITERS) { double nuclearNorm = computeS(mu); double l1Norm = computeL(mu); double l2Norm = computeE(); obj = computeObjective(nuclearNorm, l1Norm, l2Norm); diff = Math.abs(objPrev - obj); objPrev = obj; mu = computeDynamicMu(); iter = iter + 1; } }
private void computeRSVD() { double mu = X.getColumnDimension() * X.getRowDimension() / (4 * l1norm(X.getData())); double objPrev = 0.5*Math.pow(X.getFrobeniusNorm(), 2); double obj = objPrev; double tol = 1e-8 * objPrev; double diff = 2 * tol; int iter = 0; while(diff > tol && iter < MAX_ITERS) { double nuclearNorm = computeS(mu); double l1Norm = computeL(mu); double l2Norm = computeE(); obj = computeObjective(nuclearNorm, l1Norm, l2Norm); diff = Math.abs(objPrev - obj); objPrev = obj; mu = computeDynamicMu(); iter = iter + 1; } }
private void computeRSVD() { double mu = X.getColumnDimension() * X.getRowDimension() / (4 * l1norm(X.getData())); double objPrev = 0.5*Math.pow(X.getFrobeniusNorm(), 2); double obj = objPrev; double tol = 1e-8 * objPrev; double diff = 2 * tol; int iter = 0; while(diff > tol && iter < MAX_ITERS) { double nuclearNorm = computeS(mu); double l1Norm = computeL(mu); double l2Norm = computeE(); obj = computeObjective(nuclearNorm, l1Norm, l2Norm); diff = Math.abs(objPrev - obj); objPrev = obj; mu = computeDynamicMu(); iter = iter + 1; } }
private void computeRSVD() { double mu = X.getColumnDimension() * X.getRowDimension() / (4 * l1norm(X.getData())); double objPrev = 0.5*Math.pow(X.getFrobeniusNorm(), 2); double obj = objPrev; double tol = 1e-8 * objPrev; double diff = 2 * tol; int iter = 0; while(diff > tol && iter < MAX_ITERS) { double nuclearNorm = computeS(mu); double l1Norm = computeL(mu); double l2Norm = computeE(); obj = computeObjective(nuclearNorm, l1Norm, l2Norm); diff = Math.abs(objPrev - obj); objPrev = obj; mu = computeDynamicMu(); iter = iter + 1; } }
pc = zeros(dimension, 1); // evolution paths for C and sigma ps = zeros(dimension, 1); // B defines the coordinate system normps = ps.getFrobeniusNorm();
/** * Update of the evolution paths ps and pc. * * @param zmean Weighted row matrix of the gaussian random numbers generating * the current offspring. * @param xold xmean matrix of the previous generation. * @return hsig flag indicating a small correction. */ private boolean updateEvolutionPaths(RealMatrix zmean, RealMatrix xold) { ps = ps.scalarMultiply(1 - cs).add( B.multiply(zmean).scalarMultiply(FastMath.sqrt(cs * (2 - cs) * mueff))); normps = ps.getFrobeniusNorm(); final boolean hsig = normps / FastMath.sqrt(1 - FastMath.pow(1 - cs, 2 * iterations)) / chiN < 1.4 + 2 / ((double) dimension + 1); pc = pc.scalarMultiply(1 - cc); if (hsig) { pc = pc.add(xmean.subtract(xold).scalarMultiply(FastMath.sqrt(cc * (2 - cc) * mueff) / sigma)); } return hsig; }
/** * Update of the evolution paths ps and pc. * * @param zmean Weighted row matrix of the gaussian random numbers generating * the current offspring. * @param xold xmean matrix of the previous generation. * @return hsig flag indicating a small correction. */ private boolean updateEvolutionPaths(RealMatrix zmean, RealMatrix xold) { ps = ps.scalarMultiply(1 - cs).add( B.multiply(zmean).scalarMultiply( FastMath.sqrt(cs * (2 - cs) * mueff))); normps = ps.getFrobeniusNorm(); final boolean hsig = normps / FastMath.sqrt(1 - FastMath.pow(1 - cs, 2 * iterations)) / chiN < 1.4 + 2 / ((double) dimension + 1); pc = pc.scalarMultiply(1 - cc); if (hsig) { pc = pc.add(xmean.subtract(xold).scalarMultiply(FastMath.sqrt(cc * (2 - cc) * mueff) / sigma)); } return hsig; }
pc = zeros(dimension, 1); // evolution paths for C and sigma ps = zeros(dimension, 1); // B defines the coordinate system normps = ps.getFrobeniusNorm();