You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if newWeights.rows != currentWeights.rows && newWeights.columns != currentWeights.columns {
68
+
throwMachineLearningError.invalidInput
69
+
}
70
+
}
71
+
72
+
self.weights = newWeights
73
+
}
74
+
75
+
76
+
/**
77
+
Manipulate the bias values of a particular Layer object.
78
+
79
+
- parameter newBias: Bias as a matrix. Shape (rows and columns) must be equivalent to the bias of the Layer object being manipulated.
80
+
81
+
*/
82
+
publicfunc editBias(newBias:Matrix<Float>)throws{
83
+
84
+
iflet currentBias =self.bias {
85
+
if newBias.rows != currentBias.rows && newBias.columns != currentBias.columns {
86
+
throwMachineLearningError.invalidInput
87
+
}
88
+
}
89
+
90
+
self.bias = newBias
91
+
}
92
+
93
+
58
94
/**
59
95
The forward method passes input into the layers neurons and produces an output matrix. The method saves the input into the Layer objects 'input' atrribute. The method also saves the activation and net value of each neuron into the 'activationValues' and 'zValues' attributes.
0 commit comments