Artificial Neural Networks for Beginners - MNIST Dataset: Unable to read file 'myWeights'. No such file or directory. Can anyone help me understand what I should do successfully load weights?

2 次查看(过去 30 天)
Hopefully someone has successfully managed to follow the example and can point me in the right direction.
I have imported the data.
tr = csvread('train.csv', 1, 0); % read train.csv sub = csvread('test.csv', 1, 0); % read test.csv
Conducted data preparation.
Used the Neural Network Toolbox GUI API to create myNNfunc.m and myNNscript.m
I created VisualizingLearnedWeights.m. When I run this file I get an error message load myWeights % load the learned weights W1 =zeros(100, 28*28); % pre-allocation W1(:, x1_step1_keep) = IW1_1; % reconstruct the full matrix figure % plot images colormap(gray) % set to grayscale for i = 1:25 % preview first 25 samples subplot(5,5,i) % plot them in 6 x 6 grid digit = reshape(W1(i,:), [28,28])'; % row = 28 x 28 image imagesc(digit) % show the image end
the error message is: % Error using load % Unable to read file 'myWeights'. No such file or directory.
% Error in VisualizingLearnedWeights (line 7) % load myWeights % load the learned weights
In the workspace I can not see any weights. But I find W1. I have tried to search thru every script in order to find weights.

回答(2 个)

Toshiaki Takeuchi
You should remove "load myWeights" from your script. The blog post is like a cooking show, and it is just loading the pre-computed variables into memory. All it does is to load the following variables.
  • IW1_1
  • x1_step1_keep
They are defined within myNNfunc.m, as the blog post says.

Claire Reinhardt
Claire Reinhardt 2016-5-14
Hi This my help VariableName = net.IW{1}

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by