I hereby claim:
- I am conormc98 on github.
- I am conormc98 (https://keybase.io/conormc98) on keybase.
- I have a public key ASBWmeS0mxN8dwk-MPeElynMdTcDZ5I8mpHlR977rRnnRQo
To claim this, I am signing this object:
import random | |
random.shuffle(training_data) |
for epoch in range(100): | |
for i, vals in enumerate(training_data): | |
X, Y = iter(vals) | |
X = Variable(torch.FloatTensor([X]), requires_grad=True) | |
Y = Variable(torch.FloatTensor([Y]), requires_grad=False) | |
optimizer.zero_grad() | |
outputs = net(X) | |
loss = criterion(outputs, Y) | |
loss.backward() | |
optimizer.step() |
def criterion(out, label): | |
return (label - out) ** 2 |
class Net(nn.Module): | |
def __init__(self): | |
super(Net, self).__init__() | |
self.fc1 = nn.Linear(1, 1) | |
def forward(self, x): | |
x = F.relu(self.fc1(x)) | |
return x |
training_data = [] | |
for i, val in enumerate(x_vals): | |
pairing = (val, y_vals[i]) | |
training_data.append(pairing) |
y_vals = [] | |
for val in x_vals: | |
y = (3 * val) + 5 | |
y_vals.append(y) |
x_vals = list(range(51)) |
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return "Hello World!" |
I hereby claim:
To claim this, I am signing this object: