What is the network structure to generate mean and std for sampling process in the training phase?
See original GitHub issueI am trying to reproduce the result of variational autoencoder part of the entire network. Since the training code was not released yet, I can only guess you are doing something like the following code.
I trained with this structure, but found it is really hard to get a descent result. I am wondering if you could provide more training details, such as complete network structure for training, training time, if there are some special training strageties and tricks.
self.encoder_latent = nn.Sequential(*model)
self.mu = ResnetBlock(min(ngf * mult * 2, opt.mc),
padding_type=padding_type,
activation=activation,
norm_layer=norm_layer,
opt=opt,
)
self.log_var = ResnetBlock(min(ngf * mult * 2, opt.mc),
padding_type=padding_type,
activation=activation,
norm_layer=norm_layer,
opt=opt,
)
model += [self.mu]
# model += [nn.Conv2d(min(ngf * mult * 2, opt.mc), min(ngf, opt.mc), 1, 1)]
if opt.feat_dim > 0:
# 1*1 conv
model += [nn.Conv2d(min(ngf * mult * 2, opt.mc), opt.feat_dim, 1, 1)]
self.encoder = nn.Sequential(*model)
def train_forward(self, input):
latent = self.encoder_latent(input)
mu = self.mu(latent)
log_var = self.log_var(latent)
z = self.sample(mu, log_var)
return self.decoder(z), mu, log_var
def sample(self, mu, log_var):
std = torch.exp(log_var * 0.5)
eps = torch.randn_like(mu)
return mu + std * eps
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Applied Deep Learning - Part 3: Autoencoders | by Arden Dertat
Autoencoders are a specific type of feedforward neural networks where the input is the same as the output. They compress the input into...
Read more >1 Computing the Standard Deviation of Sample Means
Quality control charts are based on sample means not on individual values within a sample. A sample is a group of items, which...
Read more >Generative Adversarial Networks: Build Your First Models
The GAN training process consists of a two-player minimax game in which D is adapted to minimize the discrimination error between real and...
Read more >A Gentle Introduction to Generative Adversarial Networks ...
GANs are an architecture for automatically training a generative model by treating the ... The generator network directly produces samples.
Read more >Standards and Guidelines for Statistical Surveys - SAMHSA
nonprobability sampling methods (e.g., cut-off or model-based samples) must be ... surveys and other means of collecting data” into the single section on ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
sorry, my fault, it’s two resnet blocks. The test code directly use mean from the encoder and feed it into the decoder(see Link. So the last layer of the encoder should output mean. As it is shown in the test code, the block to output mean is a resnet block (in testing, feat_dim = -1, so the last 1*1 convolution is not used)
README.md