Enable ruff NPY002 rule (#11336)
This commit is contained in:
@@ -51,8 +51,9 @@ class DenseLayer:
|
||||
self.is_input_layer = is_input_layer
|
||||
|
||||
def initializer(self, back_units):
|
||||
self.weight = np.asmatrix(np.random.normal(0, 0.5, (self.units, back_units)))
|
||||
self.bias = np.asmatrix(np.random.normal(0, 0.5, self.units)).T
|
||||
rng = np.random.default_rng()
|
||||
self.weight = np.asmatrix(rng.normal(0, 0.5, (self.units, back_units)))
|
||||
self.bias = np.asmatrix(rng.normal(0, 0.5, self.units)).T
|
||||
if self.activation is None:
|
||||
self.activation = sigmoid
|
||||
|
||||
@@ -174,7 +175,8 @@ class BPNN:
|
||||
|
||||
|
||||
def example():
|
||||
x = np.random.randn(10, 10)
|
||||
rng = np.random.default_rng()
|
||||
x = rng.normal(size=(10, 10))
|
||||
y = np.asarray(
|
||||
[
|
||||
[0.8, 0.4],
|
||||
|
||||
Reference in New Issue
Block a user