• Sara

    I think you made a mistake in Method2 smoohth with L1 norm according to sparse learning (http://ufldl.stanford.edu/wiki/index.php/Sparse_Coding:_Autoencoder_Interpretation):
    ‘To “smooth out” the L1 norm, we use sqrt{x^2 + epsilon} in place of |x|, ‘. Also, It isn’t right to use the L1 norm again in the right hand side of the equation that would be the approximation for the L1 norm.

    • Eric

      Hi Sara,
      I re-read the website you gave me and my code as well, I think it was a typo, you are exactly right, the right hand side L1 norm should be erased. Thank you for sharing this with me.

  • ngapweitham

    I have two questions

    1 : where is the “data.txt”?
    2 : About the codes “x = zeros(block_size * block_size, DATA_SIZE);”
    There are 64 rows and 142129 cols, is that mean every row contain one image?


    • Eric


      For data, I randomly chose a single-channel image, and extracted every single 8*8 (block_size = 8) sub-image as a an input, so the “x” in your second question is 64 * 142129 for that specific image, you can change the DATA_SIZE to match your image. Because that “x” matrix is too large, so I didn’t upload that, I’m sure you can easily generate one by using Matlab, or other equivalent tools:p

      • ngapweitham

        Ah, I get it, every columns corresponds to one block(8 * 8) pixels, thanks

  • Kei


    I want to use your sc program, but I couldn’t understand a few points.
    1.About input data, what range are its values? 0 to 255? 0 to 1? or -1 to 1?
    2.What is the definition of J(D,h)?
    3.If I want learned dictionary images, should I convert every column of ‘sc’ program’s output into an image?

    I realize you are very busy, but would you be able to answer my question?
    Forgive my bad English.
    Thank you.

  • Shi

    Read your program, I feel very good,and want download to learn

  • Joshua

    Could you elaborate on how you reconstructed the image by averaging the reconstructions of the patches? I’m guessing for patches that overlapped, you took the average of every overlapping pixel?