【发布时间】:2015-07-22 05:42:54
【问题描述】:
目前,我正在使用卷积神经网络进行纹理分类。我正在尝试使用 Matlab 代码here 来实现 ZCA 美白以预处理我的图像。
请注意,我的图像大小为 512x512,采用 RGB JPEG 格式,这会导致矩阵乘法内存不足。 (但是,我有自己的理由,我不能在我的研究中减小图像大小)
下面是我的代码实现,比如说以lena.jpg (512x512) 为例。
I = double(imread('lena.jpg')); % image size of 512x512
x = reshape(I, [], 3); % RGB vectors
avg = mean(x, 1); % Compute the mean pixel intensity value separately for each channel.
sigma = x * x' / size(x, 2); % <== I get error here
x = x - repmat(avg, size(x, 1), 1);
[U,S,V] = svd(sigma);
xZCAwhite = U * diag(1./sqrt(diag(S) + epsilon)) * U' * x;
下面是我的memory状态
Maximum possible array: 4338 MB (4.548e+09 bytes) *
Memory available for all arrays: 4338 MB (4.548e+09 bytes) *
Memory used by MATLAB: 1363 MB (1.429e+09 bytes)
Physical Memory (RAM): 8052 MB (8.443e+09 bytes)
* Limited by System Memory (physical + swap file) available.
有什么建议吗?
【问题讨论】:
标签: matlab neural-network pca