[mlpack-git] [mlpack] Create a function to visualize the features learned by sparse autoencoder (#465)
Ryan Curtin
notifications at github.com
Tue Oct 27 09:30:50 EDT 2015
> + int const squareRows = (int)std::sqrt(paramTemp.n_cols);
> + int const buf = 1;
> +
> + int const offset = squareRows+buf;
> + output.ones(buf+rows*(offset),
> + buf+cols*(offset));
> +
> + VisualizeHiddenUnit(rows, cols, squareRows,
> + offset, paramTemp, output);
> +
> + double const max = output.max();
> + double const min = output.min();
> + if((max - min) != 0)
> + {
> + output = (output - min) / (max - min) * 255;
> + }
This scales the output to the range [0, 255], but is that always what the user will want? Maybe it's worth considering a few more parameters to `MaximalInputs()` for scaling? i.e. `bool scale`, `double min`, `double max`, and you could use defaults. What do you think? I don't know if everyone is going to want to be saving specifically to PGM (or another 8-bit grayscale image format) when using this function.
---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/465/files#r43120492
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20151027/4be741fd/attachment.html>
More information about the mlpack-git
mailing list