Package pylearn :: Package sandbox :: Package sparse_random_autoassociator :: Module model
[hide private]

Module model

source code

The model for an autoassociator for sparse inputs, using Ronan Collobert + Jason Weston's sampling trick (2008).

Classes [hide private]
Model
Functions [hide private]
 
_select_indices(instance)
Choose nonzero and zero indices (feature columns) of the instance.
source code

Imports: trainfn, parameters, globals, LR, numpy, random


Function Details [hide private]

_select_indices(instance)

source code 

Choose nonzero and zero indices (feature columns) of the instance. We select all nonzero indices. We select globals.ZERO_SAMPLE_SIZE zero indices randomly, without replacement.

Returns:
(nonzero_indices, zero_indices)

Bug: If there are not ZERO_SAMPLE_SIZE zeroes, we will enter an endless loop.