Skip to content

Commit 083c1bf

Browse files
committed
Finalizing tutorial SPIE
1 parent eb713a6 commit 083c1bf

26 files changed

+104
-111
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@
219219
for i=1:obj.NumChannels
220220
x.V(:,:,:,i,:) = x.V(:,:,:,i,:) .* 1/sqrt(obj.TrainedVariance(:,:,:,i) + obj.Epsilon);
221221
end
222-
% 2) Batch normalization operation further shifts and scales the activations using Scale and Offset values
222+
% 2) Batch normalization operation further shifts and scales the
223+
% activations using Scale and Offset values
223224
% 2a) Scale values
224225
for i=1:obj.NumChannels
225226
x.V(:,:,:,i,:) = x.V(:,:,:,i,:) .* obj.Scale(:,:,:,i);
@@ -262,7 +263,8 @@
262263
for i=1:obj.NumChannels
263264
x.V(:,:,i,:) = x.V(:,:,i,:) .* 1/sqrt(obj.TrainedVariance(:,:,i) + obj.Epsilon);
264265
end
265-
% 2) Batch normalization operation further shifts and scales the activations using Scale and Offset values
266+
% 2) Batch normalization operation further shifts and scales the
267+
% activations using Scale and Offset values
266268
% 2a) Scale values
267269
for i=1:obj.NumChannels
268270
x.V(:,:,i,:) = x.V(:,:,i,:) .* obj.Scale(:,:,i);

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +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);
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);
525529
else
526530
c = dlconv(dlarray(input.V(:,:,:,1), "SSC"), obj.Weights, obj.Bias, 'Stride', obj.Stride, 'Padding', obj.PaddingSize, 'DilationFactor', obj.DilationFactor);
527531
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/Segmentation/debug.m

Lines changed: 0 additions & 74 deletions
This file was deleted.
96.7 KB
Loading
Binary file not shown.
40 KB
Loading
Binary file not shown.
Binary file not shown.
43 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)