Skip to content

Instantly share code, notes, and snippets.

@SannaPersson
Created September 13, 2022 14:03
Show Gist options
  • Save SannaPersson/a702d533dec93831eab04da11df32fbd to your computer and use it in GitHub Desktop.
Save SannaPersson/a702d533dec93831eab04da11df32fbd to your computer and use it in GitHub Desktop.
variational_autoencoder4
# Initialize model, optimizer, loss
model = VariationalAutoEncoder(INPUT_DIM, Z_DIM).to(device)
optimizer = torch.optim.Adam(model.parameters(), lr=LR_RATE)
loss_fn = nn.BCELoss(reduction="sum")
# Run training
train(NUM_EPOCHS, model, optimizer, loss_fn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment