Skip to content

Instantly share code, notes, and snippets.

View daviesl's full-sized avatar

Laurence Davies daviesl

  • Queensland University of Technology
  • Brisbane QLD
View GitHub Profile
import torch
# Set the seed for reproducibility
torch.manual_seed(42)
# True target distribution probabilities
true_probs = torch.tensor([0.2, 0.5, 0.3])
def f(x):
# Minus sign is important to ensure we are minimizing