Skip to content

Instantly share code, notes, and snippets.

View arnavs's full-sized avatar
🐧
if it's not free, it's not worth paying for

Arnav Sood arnavs

🐧
if it's not free, it's not worth paying for
View GitHub Profile
@gngdb
gngdb / example_usage.py
Last active May 18, 2022 05:32
Wrap PyTorch functions for scipy's optimize.minimize: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.minimize.html (I also made a repo to do this https://github.com/gngdb/pytorch-minimize, although I had forgotten about this gist at the time)
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
from scipy import optimize
from obj import PyTorchObjective