149ec80539b903677c6c69fe52968867dd50c95f,VAEs/vq-vae/models/vq_vae.py,VectorQuantizerEMA,__init__,#VectorQuantizerEMA#,78

Before Change


		self.epsilon = epsilon

		with nn.parameter_scope(scope_name):
			self.embedding_weight = nn.parameter.get_parameter_or_create("W", shape=(self.num_embedding, self.embedding_dim),
			initializer=I.NormalInitializer(rng=self.rng), need_grad=True)

			self.ema_cluster_size = nn.parameter.get_parameter_or_create("ema_cluster_size", shape = (self.num_embedding,), 

After Change


		// with nn.parameter_scope(scope_name):
			// self.embedding_weight = nn.parameter.get_parameter_or_create("emb/W", shape=(self.num_embedding, self.embedding_dim),
			// initializer=I.NormalInitializer(rng=self.rng), need_grad=True)
		self.embedding_weight = nn.Variable.from_numpy_array(np.random.randn(self.num_embedding, self.embedding_dim))
		self.embedding_weight.need_grad = True
		self.ema_cluster_size = nn.Variable.from_numpy_array(np.zeros(self.num_embedding,))
		self.ema_cluster_size.need_grad = False
		self.ema_w = nn.Variable.from_numpy_array(np.random.randn(self.num_embedding, self.embedding_dim))
		self.ema_w.need_grad = True

			// self.ema_cluster_size = nn.parameter.get_parameter_or_create("ema_cluster_size", shape = (self.num_embedding,), 
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: sony/nnabla-examples
Commit Name: 149ec80539b903677c6c69fe52968867dd50c95f
Time: 2019-07-15
Author: Krishna.Wadhwani@sony.com
File Name: VAEs/vq-vae/models/vq_vae.py
Class Name: VectorQuantizerEMA
Method Name: __init__


Project Name: sony/nnabla-examples
Commit Name: 149ec80539b903677c6c69fe52968867dd50c95f
Time: 2019-07-15
Author: Krishna.Wadhwani@sony.com
File Name: VAEs/vq-vae/models/vq_vae.py
Class Name: VectorQuantizerEMA
Method Name: __init__


Project Name: fabianp/mord
Commit Name: d6b3be05efb58245a55a61bd64ebec630004cf70
Time: 2015-09-09
Author: f@bianp.net
File Name: test.py
Class Name:
Method Name:


Project Name: nipy/dipy
Commit Name: 3789de488113316b303be36e2f7d4bb2e405f47f
Time: 2020-10-13
Author: arokem@gmail.com
File Name: dipy/io/tests/test_utils.py
Class Name:
Method Name: test_read_img_arr_or_path