MCPcopy
hub / github.com/ddbourgin/numpy-ml / _init_params

Method _init_params

numpy_ml/neural_nets/layers/layers.py:3408–3418  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3406 self.is_initialized = False
3407
3408 def _init_params(self):
3409 init_weights = WeightInitializer(str(self.act_fn), mode=self.init)
3410
3411 fr, fc = self.kernel_shape
3412 W = init_weights((fr, fc, self.in_ch, self.out_ch))
3413 b = np.zeros((1, 1, 1, self.out_ch))
3414
3415 self.parameters = {"W": W, "b": b}
3416 self.gradients = {"W": np.zeros_like(W), "b": np.zeros_like(b)}
3417 self.derived_variables = {"Z": [], "out_rows": [], "out_cols": []}
3418 self.is_initialized = True
3419
3420 @property
3421 def hyperparameters(self):

Callers 1

forwardMethod · 0.95

Calls 1

WeightInitializerClass · 0.85

Tested by

no test coverage detected