physbo.blm.basis.fourier module

class physbo.blm.basis.fourier.fourier(params)[source]

Bases: object

random feature maps Psi(X; W,b) = cos[X * Wt + b] * alpha where

  • X: input, N-by-d matrix

  • W: weight, l-by-d matrix

  • Wt: transpose of W

  • b: bias, 1-by-l matrix

  • alpha: coefficient

and

  • N: number of data

  • d: dimension of input

  • l: number of basis

params

W, b, alpha

Type:

Tuple

nbasis

number of basis

Type:

int

References

A. Rahimi and B. Recht, “Random features for large-scale kernel machines,” in “Advances in neural information processing systems,” 2007, pp. 1177-1184.

get_basis(X, params=None)[source]

compute the value of basis

Parameters:
  • X (numpy.ndarray) – input

  • params (Tuple) – W, b, alpha (default: self.params)

Returns:

Psi(X; W,b) – N-by-l matrix

cos[X * Wt + b] * alpha

where Wt is the transpose of W.

Return type:

numpy.ndarray

set_params(params)[source]

update basis parameters

Parameters:

params (tuple) – W, b, alpha

show()[source]

print parameters