Projection Matrix Factory

Module for the factory class for projection matrices

ProjectionFactory.beta

Beta distribution

ProjectionFactory.cauchy

Cauchy distribution

ProjectionFactory.dirichlet

Dirichlet distribution

ProjectionFactory.laplace

Laplace distribution

ProjectionFactory.multivariate_normal

Multivariate normal distribution

ProjectionFactory.normal

Normal distribution

ProjectionFactory.projections

ProjectionFactory.uniform

Uniform distribution

class ProjectionFactory[source]

Bases: object

Factory class that spawns projection matrices.

Example
>>> from athena import ProjectionFactory
>>> import numpy as np
>>> input_dim = 2
>>> n_features = 40
>>> params = [1.1, 2.9]
>>> for pname in ProjectionFactory.projections:
>>>     y = ProjectionFactory(pname)(input_dim, n_features, params)
static __new__(cls, fname)[source]

Create and return a new object. See help(type) for accurate signature.

static beta(input_dim, n_features, params)[source]

Beta distribution

Parameters
  • input_dim (int) – dimension of the inputs.

  • n_features (int) – dimension of the RKHS.

  • params (list) – the two parameters are the alpha and beta shape parameters respectively.

Returns

n_features-by-input_dim projection matrix.

Return type

numpy.ndarray.

static cauchy(input_dim, n_features, params)[source]

Cauchy distribution

Parameters
  • input_dim (int) – dimension of the inputs.

  • n_features (int) – dimension of the RKHS.

  • params (list) – the single parameter is a scale factor.

Returns

n_features-by-input_dim projection matrix.

Return type

numpy.ndarray.

static dirichlet(input_dim, n_features, params)[source]

Dirichlet distribution

Parameters
  • input_dim (int) – dimension of the inputs.

  • n_features (int) – dimension of the RKHS.

  • params (list) – the single parameter is a scale to the input_dim dimensional shape parameter.

Returns

n_features-by-input_dim projection matrix.

Return type

numpy.ndarray.

static laplace(input_dim, n_features, params)[source]

Laplace distribution

Parameters
  • input_dim (int) – dimension of the inputs.

  • n_features (int) – dimension of the RKHS.

  • params (list) – the single parameter is the scale of the distribution, the mean is set to 0.

Returns

n_features-by-input_dim projection matrix.

Return type

numpy.ndarray.

static multivariate_normal(input_dim, n_features, params)[source]

Multivariate normal distribution

Parameters
  • input_dim (int) – dimension of the inputs.

  • n_features (int) – dimension of the RKHS.

  • params (list) – the input_dim dimensioanl parameters are the

diagonal of the covariance matrix of the distribution. The mean is set to the 0 vector. :return: n_features-by-input_dim projection matrix. :rtype: numpy.ndarray.

static normal(input_dim, n_features, params)[source]

Normal distribution

Parameters
  • input_dim (int) – dimension of the inputs.

  • n_features (int) – dimension of the RKHS.

  • params (list) – the single parameter is the variance of the distribution. The mean is set to 0.

Returns

n_features-by-input_dim projection matrix.

Return type

numpy.ndarray.

projections = ['beta', 'cauchy', 'dirichlet', 'laplace', 'multivariate_normal', 'normal', 'uniform']
static uniform(input_dim, n_features, params)[source]

Uniform distribution

Parameters
  • input_dim (int) – dimension of the inputs.

  • n_features (int) – dimension of the RKHS.

  • params (list) – the two parameters are the extremals of the domain.

Returns

n_features-by-input_dim projection matrix.

Return type

numpy.ndarray.