MCPcopy Create free account
hub / github.com/alibaba/euler / build

Method build

tf_euler/python/utils/encoders.py:657–673  ·  view source on GitHub ↗
(self, input_shape)

Source from the content-addressed store, hash-verified

655 self.store_init_maxval = store_init_maxval
656
657 def build(self, input_shape):
658 self.stores = [
659 tf.get_variable('store_layer_{}'.format(i),
660 [self.max_id + 2, dim],
661 initializer=tf.random_uniform_initializer(
662 maxval=self.store_init_maxval, seed=1),
663 trainable=False,
664 collections=[tf.GraphKeys.LOCAL_VARIABLES])
665 for i, dim in enumerate(self.dims[1: -1], 1)]
666 self.gradient_stores = [
667 tf.get_variable('gradient_store_layer_{}'.format(i),
668 [self.max_id + 2, dim],
669 initializer=tf.zeros_initializer(),
670 trainable=False,
671 collections=[tf.GraphKeys.LOCAL_VARIABLES])
672 for i, dim in enumerate(self.dims[1: -1], 1)]
673 self.store_optimizer = tf.train.AdamOptimizer(self.store_learning_rate)
674
675 def call(self, inputs, training=None):
676 if not training:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected