Skip to content

Instantly share code, notes, and snippets.

View gagejustins's full-sized avatar

Justin Gage gagejustins

  • New York City
View GitHub Profile
date value
11/1/15 300
12/1/15 378.375
1/1/16 333.7916667
2/1/16 330.7696078
3/1/16 347.2945545
4/1/16 363.2814465
5/1/16 323.4774096
6/1/16 288.9470878
7/1/16 284.7981057
@gagejustins
gagejustins / call.py
Last active July 9, 2020 20:43
Code for my tutorial on CNNs in Pytorch
CNN = SimpleCNN()
trainNet(CNN, batch_size=32, n_epochs=5, learning_rate=0.001)
#Import the optim module from the pytorch package
import torch.optim as optim
#Initialize an optimizer object
learning_rate = 0.001
optimizer = optim.Adam(net.parameters(), lr=learning_rate)
#Set the parameter gradients to 0 and take a step (as part of a training loop)
for epoch in num_epochs:
train(...)