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

Ryan Curtin notifications at github.com
Mon Nov 2 15:52:43 EST 2015


> The purpose of this function is visualize the learning results of autoencoder , even it is non-image data, you could use this function to visualize it too(ex : audio data). Extract the maximal inputs into each col is more general, but I can not imagine what is the used of it, maybe this is a little bit over designed.

How would this work for audio data?  Assuming that the input to the autoencoder is, say, a 30ms windowed frame of audio or something like that, displaying the maximal input as a square image doesn't really make sense---I would think it would be more sensible to display that as a drawn waveform, or even just play it back for the user.

> I agree with you, not all of the applications are image applications, but the purpose of this function is visualize the results learned by autoencoder ...

Unless I've misunderstood above, I really think that the `MaximalInputs()` should be generalized not just to image data but to arbitrary types of data, and then maybe some other utility function to take the maximal inputs and turn them into a useful format for saving as images would be the better design: it allows users who are not working with image data to still use the `MaximalInputs()` function, and the users who are working with image data can then do some quick postprocessing on the output of `MaximalInputs()` to get the results they are interested in.  This postprocessing could be the `ColumnsToBlocks()` function I suggested in a previous comment, or maybe something similar to that.

Following that line of thought, I think it might be better to have the scaling in the postprocessing after `MaximalInputs()`, but I'm not picky either way as long as the default is for no scaling (the idea here is that it's better to make fewer assumptions on a user's data).  Maybe a better design would be like this:

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

> Appreciate your inputs, this kind of conversations and code reviews really help me learn something.

Thanks---it takes a long time to have discussions like this, but it is my belief that it leads to better code in the end.  I learn a lot from these discussions too. :)

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


More information about the mlpack-git mailing list