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

Method _get_weights

tensorlayer/layers/core.py:299–310  ·  view source on GitHub ↗

Get trainable variables.

(self, var_name, shape, init=tl.initializers.random_normal(), trainable=True)

Source from the content-addressed store, hash-verified

297 self._nodes_fixed = True
298
299 def _get_weights(self, var_name, shape, init=tl.initializers.random_normal(), trainable=True):
300 """ Get trainable variables. """
301 weight = get_variable_with_initializer(scope_name=self.name, var_name=var_name, shape=shape, init=init)
302 if trainable is True:
303 if self._trainable_weights is None:
304 self._trainable_weights = list()
305 self._trainable_weights.append(weight)
306 else:
307 if self._nontrainable_weights is None:
308 self._nontrainable_weights = list()
309 self._nontrainable_weights.append(weight)
310 return weight
311
312 @abstractmethod
313 def build(self, inputs_shape):

Callers 15

buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80
buildMethod · 0.80

Calls 1

Tested by 1

buildMethod · 0.64