Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
plot_batch_detailed(fixed_batch)
# Set latent dims to output dims
if (args.latent_dims == 0):
args.latent_dims = args.output_size
"""
###################
Model definition section
###################
"""
print('[Creating model]')
if (args.model in ['ae', 'vae', 'wae', 'flow']):
# Construct encoding and decoding architectures
encoder, decoder = construct_architecture(args)
# Construct synthesizer
synth = construct_synth(args)
# Finally construct the full model (first only AE)
model = DDSSynth(encoder, decoder, synth, args)
else:
raise Exception('Unknown model ' + args.model)
# Send model to device
model = model.to(args.device)
"""
###################
Optimizer section
###################
"""
# Optimizer model
optimizer = optim.Adam(model.parameters(), lr=args.lr)
# Learning rate scheduler
scheduler = optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode='min', factor=0.5, patience=20, verbose=True, threshold=1e-7)