exponential_family_harmonium: Exponential Family Harmoniums

Description Usage Arguments Value References Examples

Description

Welling et al. (2005)'s Exponential Family Harmoniums

Usage

1
2
3
4
5
exponential_family_harmonium(x, k = 2, family = c("gaussian", "binomial",
  "poisson"), family_hidden = c("gaussian", "binomial", "poisson"),
  cd_iters = 1, learning_rate = 0.001, max_iters = 100,
  rms_prop = FALSE, quiet = TRUE, random_start = TRUE, start_W, mu,
  main_effects = TRUE)

Arguments

x

matrix of either binary, count, or continuous data

k

dimension (number of hidden units)

family

exponential family distribution of data

family_hidden

exponential family distribution of hidden units

cd_iters

number of iterations for contrastive divergence (CD) at each iteration. It should be a vector of two integers, which is the range of CD interations that the algorithm will perform from the beginning until the end, linearly interpolated

learning_rate

learning rate used for gradient descent

max_iters

maximum number of iterations

rms_prop

logical; whether to use RMS prop for optimization. Default is FALSE.

quiet

logical; whether the calculation should give feedback

random_start

whether to randomly initialize W

start_W

initial value for W

mu

specific value for mu, the mean (bias) vector of x

main_effects

logical; whether to include main effects (bias terms) in the model

Value

An S3 object of class efh which is a list with the following components:

mu

the main effects (bias terms) for dimensionality reduction

hidden_bias

the bias for the hidden units (currently hard coded to 0)

W

the dxk-dimentional matrix with the loadings

family

the exponential family of the data

family_hidden

the exponential family of the hidden units

iters

number of iterations required for convergence

loss_trace

the trace of the average deviance of the algorithm. Should be non-increasing

prop_deviance_expl

the proportion of deviance explained by this model. If main_effects = TRUE, the null model is just the main effects, otherwise the null model estimates 0 for all natural parameters.

References

Welling, Max, Michal Rosen-Zvi, and Geoffrey E. Hinton. "Exponential family harmoniums with an application to information retrieval." Advances in neural information processing systems. 2005.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
rows = 100
cols = 10
set.seed(1)
mat_np = outer(rnorm(rows), rnorm(cols))

# generate a count matrix and binary response
mat = matrix(rpois(rows * cols, c(exp(mat_np))), rows, cols)
mat[1, 1] <- NA

modp = exponential_family_harmonium(mat, k = 2, family = "poisson", quiet = FALSE,
                                    learning_rate = 0.001, rms_prop = FALSE, max_iters = 250)
gmf = generalizedMF(mat, k = 1, family = "poisson", quiet = FALSE)

andland/generalizedPCA documentation built on May 12, 2019, 2:42 a.m.