Skip to content

Instantly share code, notes, and snippets.

@franckjay
Created December 30, 2020 23:54
Show Gist options
  • Save franckjay/a9b04821dec2a4f19430e6bc8abd0eef to your computer and use it in GitHub Desktop.
Save franckjay/a9b04821dec2a4f19430e6bc8abd0eef to your computer and use it in GitHub Desktop.
lambda_ = 0.05
G += torch.eye(G.shape[0])*lambda_
tensor([
[1.0500, 0.0000, 0.0000, 0.0000, 1.0000, 1.0000],
[0.0000, 1.0500, 1.0000, 1.0000, 0.0000, 0.0000],
[0.0000, 1.0000, 1.0500, 1.0000, 0.0000, 0.0000],
[0.0000, 1.0000, 1.0000, 2.0500, 0.0000, 1.0000],
[1.0000, 0.0000, 0.0000, 0.0000, 1.0500, 1.0000],
[1.0000, 0.0000, 0.0000, 1.0000, 1.0000, 2.0500]
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment