Skip to content

Commit d769519

Browse files
committed
Finalize SPIE tutorial
1 parent 083c1bf commit d769519

20 files changed

+175
-25
lines changed

code/nnv/engine/nn/layers/Conv2DLayer.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,12 @@ function set_name(obj, name)
520520

521521
% compute output sets
522522
if ~isa(input.V, 'gpuArray')
523-
% c = vl_nnconv(input.V(:,:,:,1), obj.Weights, obj.Bias, 'Stride', obj.Stride, 'Pad', obj.PaddingSize, 'Dilate', obj.DilationFactor);
524-
% V = vl_nnconv(input.V(:,:,:,2:input.numPred + 1), obj.Weights, [], 'Stride', obj.Stride, 'Pad', obj.PaddingSize, 'Dilate', obj.DilationFactor);
525-
c = dlconv(dlarray(input.V(:,:,:,1), "SSC"), obj.Weights, obj.Bias, 'Stride', obj.Stride, 'Padding', obj.PaddingSize, 'DilationFactor', obj.DilationFactor);
526-
V = dlconv(dlarray(input.V(:,:,:,2:input.numPred + 1), "SSCB"), obj.Weights, 0, 'Stride', obj.Stride, 'Padding', obj.PaddingSize, 'DilationFactor', obj.DilationFactor);
527-
c = extractdata(c);
528-
V = extractdata(V);
523+
c = vl_nnconv(input.V(:,:,:,1), obj.Weights, obj.Bias, 'Stride', obj.Stride, 'Pad', obj.PaddingSize, 'Dilate', obj.DilationFactor);
524+
V = vl_nnconv(input.V(:,:,:,2:input.numPred + 1), obj.Weights, [], 'Stride', obj.Stride, 'Pad', obj.PaddingSize, 'Dilate', obj.DilationFactor);
525+
% c = dlconv(dlarray(input.V(:,:,:,1), "SSC"), obj.Weights, obj.Bias, 'Stride', obj.Stride, 'Padding', obj.PaddingSize, 'DilationFactor', obj.DilationFactor);
526+
% V = dlconv(dlarray(input.V(:,:,:,2:input.numPred + 1), "SSCB"), obj.Weights, 0, 'Stride', obj.Stride, 'Padding', obj.PaddingSize, 'DilationFactor', obj.DilationFactor);
527+
% c = extractdata(c);
528+
% V = extractdata(V);
529529
else
530530
c = dlconv(dlarray(input.V(:,:,:,1), "SSC"), obj.Weights, obj.Bias, 'Stride', obj.Stride, 'Padding', obj.PaddingSize, 'DilationFactor', obj.DilationFactor);
531531
V = dlconv(dlarray(input.V(:,:,:,2:input.numPred + 1), "SSCB"), obj.Weights, 0, 'Stride', obj.Stride, 'Padding', obj.PaddingSize, 'DilationFactor', obj.DilationFactor);

code/nnv/examples/Tutorial/SPIE/Classification2D/exampleVizRanges.m

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@
6969

7070
% Evaluate input image
7171
Y_outputs = net.evaluate(img);
72-
[~, yPred] = max(Y_outputs); % (expected: y = 1)
72+
[~, yPred] = max(Y_outputs);
7373

7474
% Evaluate lower and upper bounds
7575
LB_outputs = net.evaluate(lb_clip);
76-
[~, LB_Pred] = max(LB_outputs); % (expected: y = 1)
76+
[~, LB_Pred] = max(LB_outputs);
7777
UB_outputs = net.evaluate(ub_clip);
78-
[~, UB_Pred] = max(UB_outputs); % (expected: y = 1)
78+
[~, UB_Pred] = max(UB_outputs);
7979

8080
% Now, we can do the verification process of this image w/ L_inf attack
8181

@@ -118,8 +118,3 @@
118118
xlim([0.5 11.5]);
119119
scatter(x,Y_outputs, 'x', 'MarkerEdgeColor', 'r');
120120

121-
122-
%% Notes
123-
% The ranges obtained are an overappoximation (projection) of the
124-
% true ranges of the computed star sets
125-
Binary file not shown.
Binary file not shown.
8.05 KB
Loading
8.37 KB
Loading
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)