Пример #1
0
 def __init__(self, args):
     super(LotteryWAE, self).__init__(args)
     LotteryAE.__init__(self, args)
     WAE.__init__(self, args)
     self.pruning = args.pruning
     self.mu.unprunable = True
     self.log_var.unprunable = True
Пример #2
0
 def __init__(self, encoder, decoder, synth, args, upsampler=None):
     DDSSynth.__init__(self, encoder, decoder, synth, args, upsampler)
     WAE.__init__(self)
Пример #3
0
                                              args.encoder_dims,
                                              args.latent_dims,
                                              channels=args.channels,
                                              n_layers=args.n_layers,
                                              hidden_size=args.n_hidden,
                                              n_mlp=args.n_layers // 2,
                                              type_mod=args.layers,
                                              args=args)
 # Construct specific type of AE
 if (args.model == 'ae'):
     model = AE(encoder, decoder, args.encoder_dims, args.latent_dims)
 elif (args.model == 'vae'):
     model = VAE(encoder, decoder, args.input_size, args.encoder_dims,
                 args.latent_dims)
 elif (args.model == 'wae'):
     model = WAE(encoder, decoder, args.input_size, args.encoder_dims,
                 args.latent_dims)
 elif (args.model == 'vae_flow'):
     # Construct the normalizing flow
     flow, blocks = construct_flow(args.latent_dims,
                                   flow_type=args.flow,
                                   flow_length=args.flow_length,
                                   amortization='input')
     # Construct full VAE with given flow
     model = VAEFlow(encoder, decoder, flow, args.input_size,
                     args.encoder_dims, args.latent_dims)
 # Construct specific regressor
 regression_model = construct_regressor(args.latent_dims,
                                        args.output_size,
                                        model=args.regressor,
                                        hidden_dims=args.reg_hiddens,
                                        n_layers=args.reg_layers,