computeGradientField: Compute the multi-objective gradient vector for a set of...

Description Usage Arguments Value Examples

View source: R/computeGradientField.R

Description

Computes the multi-objective gradients for a matrix of points.

Usage

1
2
3
computeGradientField(points, fn1, fn2, fn3 = NULL, scale.step = 0.5,
  prec.grad = 1e-06, prec.norm = 1e-06, prec.angle = 1e-04,
  parallelize = FALSE, lower, upper)

Arguments

points

[matrix]
Matrix of points, for which the multi-objective gradient should be computed. Each row of the matrix will be considered as a separate point, thus the number of rows corresponds to the number of observations and the number of columns to the dimensionality of the search space.

fn1

[function]
The first objective used for computing the multi-objective gradient.

fn2

[function]
The second objective used for computing the multi-objective gradient.

fn3

[function]
The third objective used for computing the multi-objective gradient. If not provided (fn3 = NULL), the gradient field will only consider fn1 and fn2.

scale.step

[numeric(1L)]
Scaling factor for the step size in the direction of the multi-objective gradient. The default is 0.5.

prec.grad

[numeric(1L)]
Precision value (= step size) used for approximating the gradient. The default is 1e-6.

prec.norm

[numeric(1L)]
Precision threshold when normalizing a vector. That is, every element of the vector, whose absolute value is below this threshold, will be replaced by 0. The default is 1e-6.

prec.angle

[numeric(1L)]
Precision threshold used for comparing whether the angle (in degree) between two vectors is zero. The default is 1e-4.

parallelize

[logical(1L)]
Should the computation of the gradient vectors be parallelized (with parallel::mclapply)? The default is FALSE.

lower

[numeric(d)]
Vector of lower bounds.

upper

[numeric(d)]
Vector of upper bounds.

Value

[matrix]
Returns matrix of multi-objective gradients. The i-th row of the matrix contains the multi-objective gradient vector of the i-th observation (= row) of the input matrix points.

Examples

1
2
3
4
5
6
7
# Define two single-objective test problems:
fn1 = function(x) sum((x - c(0.2, 1))^2)
fn2 = function(x) sum(x)

# Create a grid of points, for which the gradients should be computed:
points = expand.grid(x1 = seq(0, 1, 0.01), x2 = seq(0, 1, 0.05))
gradient.field = computeGradientField(points, fn1, fn2)

kerschke/mogsa documentation built on July 11, 2019, 11:52 p.m.