-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtf_conv3d.m
More file actions
37 lines (29 loc) · 741 Bytes
/
tf_conv3d.m
File metadata and controls
37 lines (29 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
classdef tf_conv3d < tf_i
%TF_CONV3D Convolution 3D
% Detailed explanation goes here
properties
pad;
stride;
end
methods
function ob = tf_conv3d ()
ob.pad = 0;
ob.stride = 1;
ob.i = n_data();
ob.o = n_data();
ob.p = [n_data(), n_data()];
end % tf_conv3d
function ob = fprop(ob)
w = ob.p(1).a;
b = ob.p(2).a;
ob.o.a = mex_conv3d(ob.i.a, w,b, 'pad',ob.pad, 'stride',ob.stride);
end % fprop
function ob = bprop(ob)
w = ob.p(1).a;
b = ob.p(2).a;
delta = ob.o.d;
[ob.i.d, ob.p(1).d, ob.p(2).d] = mex_conv3d(...
ob.i.a, w, b, delta, 'pad',ob.pad, 'stride',ob.stride);
end % bprop
end
end