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

Method _init_params

numpy_ml/neural_nets/layers/layers.py:1498–1511  ·  view source on GitHub ↗
(self, X_shape)

Source from the content-addressed store, hash-verified

1496 self.is_initialized = False
1497
1498 def _init_params(self, X_shape):
1499 n_ex, in_rows, in_cols, in_ch = X_shape
1500
1501 scaler = np.random.rand(in_rows, in_cols, in_ch)
1502 intercept = np.zeros((in_rows, in_cols, in_ch))
1503
1504 self.parameters = {"scaler": scaler, "intercept": intercept}
1505
1506 self.gradients = {
1507 "scaler": np.zeros_like(scaler),
1508 "intercept": np.zeros_like(intercept),
1509 }
1510
1511 self.is_initialized = True
1512
1513 @property
1514 def hyperparameters(self):

Callers 1

forwardMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected