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

Method _init_params

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

Source from the content-addressed store, hash-verified

2973 self.is_initialized = False
2974
2975 def _init_params(self):
2976 init_weights = WeightInitializer(str(self.act_fn), mode=self.init)
2977
2978 fr, fc = self.kernel_shape
2979 W = init_weights((fr, fc, self.in_ch, self.out_ch))
2980 b = np.zeros((1, 1, 1, self.out_ch))
2981
2982 self.parameters = {"W": W, "b": b}
2983 self.gradients = {"W": np.zeros_like(W), "b": np.zeros_like(b)}
2984 self.derived_variables = {"Z": [], "out_rows": [], "out_cols": []}
2985 self.is_initialized = True
2986
2987 @property
2988 def hyperparameters(self):

Callers 1

forwardMethod · 0.95

Calls 1

WeightInitializerClass · 0.85

Tested by

no test coverage detected