---
name: "mlpack_sparse_coding_RandomInitializer"
section: "3"
platform: "linux"
package: "mlpack-doc"
version: "1.0.10-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/mlpack_sparse_coding_RandomInitializer"
---

# mlpack\_sparse\_coding\_RandomInitializer(3)

A DictionaryInitializer for use with the SparseCoding class.

## NAME

mlpack::sparse\_coding::RandomInitializer -

A DictionaryInitializer for use with the **SparseCoding** class.

## SYNOPSIS

### Static Public Member Functions

static void **Initialize** (const arma::mat &data, const size\_t atoms, arma::mat &dictionary)\
 *Initialize the dictionary randomly from a normal distribution, such that each atom has a norm of 1.*

## Detailed Description

A DictionaryInitializer for use with the **SparseCoding** class.

This provides a random, normally distributed dictionary, such that each atom has a norm of 1.

Definition at line 35 of file random\_initializer.hpp.

## Member Function Documentation

### static void mlpack::sparse\_coding::RandomInitializer::Initialize (const arma::mat &data, const size\_tatoms, arma::mat &dictionary)` [inline]`, ` [static]`

Initialize the dictionary randomly from a normal distribution, such that each atom has a norm of 1. This is simple enough to be included with the definition.

**Parameters:**

*data* Dataset to use for initialization. \
 *atoms* Number of atoms (columns) in the dictionary. \
 *dictionary* Dictionary to initialize.

Definition at line 47 of file random\_initializer.hpp.

## Author

Generated automatically by Doxygen for MLPACK from the source code.
