I am new to Matlab and still an undergrad student.
I can't seem to get an output from my code. I was given feedback that I need to call out outputSummary with the proper arguments.
I don't see what I did wrong…this is my function for my code.
%Create a function that will summarize the output of the 4 samples:
function outputSummary(inputLayerWithBias, inputLayerWeights,hiddenLayerWeights, targetOutput, totalIterations)cost = costFunction(inputLayerWithBias, inputLayerWeights,hiddenLayerWeights, targetOutput);hiddenLayer = sigmoid(inputLayerWithBias * inputLayerWeights);%we have multiple samples, so we need to add the bias to each of them
hiddenLayerWithBias = [ones(size(targetOutput,1),1) hiddenLayer];actualOutput = sigmoid(hiddenLayerWithBias * hiddenLayerWeights);fprintf('\n\n=========================================\n');fprintf('Output Summary (after %d iterations):\n', totalIterations);fprintf('Total Cost: [%f]\n', cost);for i=1:length(actualOutput) if(actualOutput(i) > 0.5) thresholdedValue = 1; else thresholdedValue = 0; end if(thresholdedValue == targetOutput(i)) fprintf('Sample [%d]: Target = [%f} Thresholded Value = [%f] Actual= [%f]\n',i, targetOutput(i), thresholdedValue, actualOutput(i)); else % else print the error in red
fprintf(2,'Sample[%d]: Target = [%f] Thresholded Value = [%f] Actual= [%f]\n', i, targetOutput(i), thresholdedValue, actualOutput(i)); endend fprintf('=========================================\n\n\n');endend
Best Answer