@@ -59,12 +59,11 @@ pure module subroutine forward(self, input)
5959 class(conv1d_layer), intent (in out ) :: self
6060 real , intent (in ) :: input(:,:)
6161 integer :: input_channels, input_width
62- integer :: j, n, a, b
63- integer :: iws, iwe, half_window
62+ integer :: j, n
63+ integer :: iws, iwe
6464
6565 input_channels = size (input, dim= 1 )
6666 input_width = size (input, dim= 2 )
67- half_window = self % kernel_size / 2
6867
6968 ! Loop over output positions.
7069 do j = 1 , self % width
@@ -95,9 +94,8 @@ pure module subroutine backward(self, input, gradient)
9594 real , intent (in ) :: gradient(:,:)
9695
9796 integer :: input_channels, input_width, output_width
98- integer :: j, n, k, a, b, c
99- integer :: iws, iwe, half_window
100- real :: gdz_val
97+ integer :: j, n, k
98+ integer :: iws, iwe
10199
102100 ! Local arrays to accumulate gradients.
103101 real :: gdz(self % filters, self % width) ! local gradient (dL/dz)
@@ -109,8 +107,6 @@ pure module subroutine backward(self, input, gradient)
109107 input_width = size (input, dim= 2 )
110108 output_width = self % width ! Note: output_width = input_width - kernel_size + 1
111109
112- half_window = self % kernel_size / 2
113-
114110 !- -- Compute the local gradient gdz = (dL/dy) * sigma'(z) for each output.
115111 do j = 1 , output_width
116112 gdz(:, j) = gradient(:, j) * self % activation % eval_prime(self % z(:, j))
0 commit comments