Skip to content

Instantly share code, notes, and snippets.

View ttpro1995's full-sized avatar
💭
meowingful

Thai Thien ttpro1995

💭
meowingful
View GitHub Profile
@ttpro1995
ttpro1995 / train_without_optim
Created May 3, 2017 11:48
Pytorch train without optim
import torch
import torch.nn as nn
from torch.autograd import Variable as Var
# define the data
dt = torch.Tensor([[1,0],[0,1], [1,1], [0,0]])
labels = torch.LongTensor([1, 0, 1, 0])
learning_rate = 0.01
model = nn.Linear(2,2)
criterion = nn.CrossEntropyLoss()
# Thai Thien
# CORRECT SPECIFICATION:
#
# the Queue class provides a fixed-size FIFO queue of integers
#
# the constructor takes a single parameter: an integer > 0 that
# is the maximum number of elements the queue can hold.
#
# empty() returns True if and only if the queue currently
#!/usr/bin/env python3
'''
Here's how you upload an image. For this example, put the cutest picture
of a kitten you can find in this script's folder and name it 'Kitten.jpg'
For more details about images and the API see here:
https://api.imgur.com/endpoints/image
'''
Verifying that "hahattpro.id" is my Blockstack ID. https://onename.com/hahattpro
@ttpro1995
ttpro1995 / app_.gitignore
Created December 29, 2014 11:47
ListViewExaple
/build