[mlpack-git] [mlpack] Create a function to visualize the features learned by sparse autoencoder (#465)

Ryan Curtin notifications at github.com
Thu Oct 29 09:04:38 EDT 2015


> If using golden model, I think we can skip the training process but feed the data MaximalInputs directly.

Ah, I agree, no need to train the autoencoder at all.

> Sure, the check I want to perform is ...

Taking a look over this made me realize that the output format for `MaximalInputs()` is not what I thought; I must have misunderstood.  It looks to me like `MaximalInputs()` will output a matrix that has each maximal input as a submatrix of the output matrix.  But because autoencoders aren't going to be applied only to images, we shouldn't write `MaximalInputs()` in a way that assumes an image application.  So I think that each column of the output matrix should correspond to a maximal input; that is, `output.col(0)` should correspond to the maximal input for hidden node 0, `output.col(1)` should correspond to the maximal input for hidden node 1, and so forth.

Then a user can do the postprocessing to save as PGM themselves, either as a snippet of standalone code or as a function.  If you wanted to add a function that prepared the output to save to PGM, that's fine, but my primary concern is that we provide tools that are general enough for all applications.  Maybe something like `ColumnsToBlocks(const arma::mat& maximalInputs, arma::mat& output, const size_t blockRows, const size_t blockCols)`, which could be used like this:

```
size_t rows, cols; // These get set to the size of the images.
arma::mat maximalInputs, parameters, output;
MaximalInputs(parameters, maximalInputs, 0, 255);
ColumnsToBlocks(maximalInputs, output, rows, cols);
data::Save("file.pgm", output);
```

Also, I think that there should be a `bool` parameter to `MaximalInputs()` to determine whether or not the output is going to be rescaled (I'd default it to false, because not all applications are image applications).

What do you think; is this a reasonable change?  I don't want to change so much that it becomes impossible to do what you were trying to do, but I do want to try and keep things general.

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/465#issuecomment-152173899
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20151029/873a10ad/attachment.html>


More information about the mlpack-git mailing list