MCPcopy
hub / github.com/tensorlayer/TensorLayer / build

Method build

tensorlayer/layers/normalization.py:270–285  ·  view source on GitHub ↗
(self, inputs_shape)

Source from the content-addressed store, hash-verified

268 raise ValueError('expected input at least 2D, but got {}D input'.format(inputs.ndim))
269
270 def build(self, inputs_shape):
271 params_shape = [self.num_features] if self.num_features is not None else self._get_param_shape(inputs_shape)
272
273 self.beta, self.gamma = None, None
274 if self.beta_init:
275 self.beta = self._get_weights("beta", shape=params_shape, init=self.beta_init)
276
277 if self.gamma_init:
278 self.gamma = self._get_weights("gamma", shape=params_shape, init=self.gamma_init)
279
280 self.moving_mean = self._get_weights(
281 "moving_mean", shape=params_shape, init=self.moving_mean_init, trainable=False
282 )
283 self.moving_var = self._get_weights(
284 "moving_var", shape=params_shape, init=self.moving_var_init, trainable=False
285 )
286
287 def forward(self, inputs):
288 self._check_input_shape(inputs)

Callers 1

__init__Method · 0.95

Calls 2

_get_param_shapeMethod · 0.95
_get_weightsMethod · 0.80

Tested by

no test coverage detected