python/methylnet/models.py
def sample_z(self, mean, logvar):
		"""Sample latent embeddings, reparameterize by adding noise to embedding.

		Parameters
		----------
		mean : type
			Learned mean vector of embeddings.
		logvar : type
			Learned variance of learned mean embeddings.

		Returns
		-------
		torch.tensor
			Mean + noise, reparameterization trick.

		"""
		stddev = torch.exp(0.5 * logvar)
		noise = Variable(torch.randn(stddev.size()))
		if self.cuda_on:
			noise=noise.cuda()
		if not self.training:
			noise = 0.
			stddev = 0.
		return (noise * stddev) + mean
Sample latent embeddings, reparameterize by adding noise to embedding.

		Parameters
		----------
		mean : type
			Learned mean vector of embeddings.
		logvar : type
			Learned variance of learned mean embeddings.

		Returns
		-------
		torch.tensor
			Mean + noise, reparameterization trick.

		
Sample latent embeddings, reparameterize by adding noise to embedding.
Parameters

mean : type
Learned mean vector of embeddings.
logvar : type
Learned variance of learned mean embeddings.

Returns

torch.tensor
Mean + noise, reparameterization trick.
Sample latent embeddings reparameterize by adding noise to embedding . Parameters mean : type Learned mean vector of embeddings . logvar : type Learned variance of learned mean embeddings . Returns torch . tensor Mean + noise reparameterization trick .
def sample_z(self, mean, logvar):
		stddev = torch.exp(0.5 * logvar)
		noise = Variable(torch.randn(stddev.size()))
		if self.cuda_on:
			noise=noise.cuda()
		if not self.training:
			noise = 0.
			stddev = 0.
		return (noise * stddev) + mean
def sample_z ( self , mean , logvar ) : stddev = torch . exp ( 0.5 * logvar ) noise = Variable ( torch . randn ( stddev . size ( ) ) ) if self . cuda_on : noise = noise . cuda ( ) if not self . training : noise = 0. stddev = 0. return ( noise * stddev ) + mean
Sample latent embeddings, reparameterize by adding noise to embedding.
Sample latent embeddings reparameterize by adding noise to embedding .
"""Sample latent embeddings, reparameterize by adding noise to embedding.

		Parameters
		----------
		mean : type
			Learned mean vector of embeddings.
		logvar : type
			Learned variance of learned mean embeddings.

		Returns
		-------
		torch.tensor
			Mean + noise, reparameterization trick.

		"""
self
mean
logvar