func

func

Various analytical functions for testing the methods.

quinn.func.funcs.blundell(xx, datanoise=0.0)[source]

Classical example from Blundell et al. [1].

\[f(x)=x+0.3 \sin(2\pi(x+\sigma\:{\cal N}(0,1)))+0.3 \sin(4\pi(x+\sigma\:{\cal N}(0,1)))+\sigma\:{\cal N}(0,1)\]
Parameters:
  • xx (np.ndarray) – Input array \(x\) of size (N,d).

  • datanoise (float, optional) – Standard deviation \(\sigma\) of i.i.d. gaussian noise, both on the input and output.

Returns:

Output array of size (N,d).

Return type:

np.ndarray

Note

This function is typically used in d=1 setting.

quinn.func.funcs.Sine(xx, datanoise=0.0)[source]

Simple sum of sines function

\[f(x)=\sin(x_1)+...+\sin(x_d) + \sigma \: {\cal N} (0,1)\]
Parameters:
  • xx (np.ndarray) – Input array \(x\) of size (N,d).

  • datanoise (float, optional) – Standard deviation \(\sigma\) of i.i.d. gaussian noise.

Returns:

Output array of size (N,1).

Return type:

np.ndarray

quinn.func.funcs.Summation(xx, datanoise=0.0)[source]

Summation function.

\[f(x)=x_1 + x_2 + \dots + x_d + \sigma \: {\cal N} (0,1)\]
Parameters:
  • xx (np.ndarray) – Input array \(x\) of size (N,d).

  • datanoise (float, optional) – Standard deviation \(\sigma\) of i.i.d. gaussian noise, both on the input and output.

Returns:

Output array of size (N,d).

Return type:

np.ndarray

quinn.func.funcs.Sine10(xx, datanoise=0.02)[source]

Sum of sines function with 10 outputs

\[\begin{split}f_1(x)=\sin(x_1)+...+\sin(x_d) + \sigma \: {\cal N} (0,1)\\ \dots \qquad\qquad\qquad\qquad\\ f_{10}(x)=\sin(x_1)+...+\sin(x_d) + \sigma \: {\cal N} (0,1)\end{split}\]
Parameters:
  • xx (np.ndarray) – Input array \(x\) of size (N,d).

  • datanoise (float, optional) – Standard deviation \(\sigma\) of i.i.d. gaussian noise.

Returns:

Output array of size (N,10).

Return type:

np.ndarray

quinn.func.funcs.Ackley(x, datanoise=0.02)[source]

Ackley4 or Modified Ackley function from https://arxiv.org/pdf/1308.4008v1.pdf.

\[f(x)=\sum_{i=1}^{d-1} \left(\exp(-0.2)\sqrt{x_i^2+x_{i+1}^2} + 3 (\cos{2x_i}+\sin{2x_{i+1}})\right) + \sigma \: {\cal N} (0,1)\]
Parameters:
  • xx (np.ndarray) – Input array \(x\) of size (N,d).

  • datanoise (float, optional) – Standard deviation \(\sigma\) of i.i.d. gaussian noise.

Returns:

Output array of size (N,1).

Return type:

np.ndarray

quinn.func.funcs.x5(xx, datanoise=0.0)[source]

Fifth power function.

Parameters:
  • xx (np.ndarray) – Input array \(x\) of size (N,d).

  • datanoise (float, optional) – Standard deviation \(\sigma\) of i.i.d. gaussian noise.