F
falderals
Error 1 Variable 'j' hides a variable in an enclosing block.
How do I fix this error? Thanks
Protected Sub ComputeA(ByVal i As Integer)
Dim sk As Single
Dim l As Integer = nn.N_Layers-1
' For the last layer
Dim j As Integer
For j = 0 To nn(l).N_Neurons - 1
nn(l)(j).A = nn(l)(j).OutputPrime * e(j)
Next j
' For other layer
l -= 1
Do While l>=0
Dim j As Integer******* error points to here....******
For j = 0 To nn(l).N_Neurons - 1
sk = 0f
Dim k As Integer
For k = 0 To nn(l+1).N_Neurons - 1
sk += nn(l+1)(k).A * nn(l+1)(k)(j)
Next k
nn(l)(j).A = nn(l)(j).OutputPrime * sk
Next j
l -= 1
Loop
End Sub
How do I fix this error? Thanks
Protected Sub ComputeA(ByVal i As Integer)
Dim sk As Single
Dim l As Integer = nn.N_Layers-1
' For the last layer
Dim j As Integer
For j = 0 To nn(l).N_Neurons - 1
nn(l)(j).A = nn(l)(j).OutputPrime * e(j)
Next j
' For other layer
l -= 1
Do While l>=0
Dim j As Integer******* error points to here....******
For j = 0 To nn(l).N_Neurons - 1
sk = 0f
Dim k As Integer
For k = 0 To nn(l+1).N_Neurons - 1
sk += nn(l+1)(k).A * nn(l+1)(k)(j)
Next k
nn(l)(j).A = nn(l)(j).OutputPrime * sk
Next j
l -= 1
Loop
End Sub