Comments (4)
Out of curiosity do you have a minimal example maybe that shows the issue?
from course22p2.
Hi @PiotrCzapla
Right before the random sampling section we define fit as:
def fit():
for epoch in range(epochs):
for xb,yb in train_dl:
pred = model(xb)
loss = loss_func(pred, yb)
loss.backward()
opt.step()
opt.zero_grad()
report(loss, preds, yb)
We define pred on line 4 in our loop, but we call report on preds in the last line. In most of the other fit functions it assigns the prediction to preds correctly such as the first fit function in the same notebook:
def fit():
for epoch in range(epochs):
for i in range(0, n, bs):
s = slice(i, min(n,i+bs))
xb,yb = x_train[s],y_train[s]
preds = model(xb)
loss = loss_func(preds, yb)
loss.backward()
with torch.no_grad():
for p in model.parameters(): p -= p.grad * lr
model.zero_grad()
report(loss, preds, yb)
from course22p2.
I see what you mean, it is in 04_minibatch_training just before jupyter chapter "Random sampling". :) I made a fix #19 with github.dev it is super easy nowadays to make such changes directly in the browser even to notebooks ! :)
Thank you.
from course22p2.
I did not know that. Thanks, I will try it next time!
from course22p2.
Related Issues (9)
- cannot install HOT 2
- MetricsCB assumes n_inp=1 HOT 3
- Release date in sight? HOT 1
- Missing train attribute in WandBCB
- Two definitions of conv imported in resnet.py
- RecorderCB plt not defined error
- Performance difference in lin_grad function (elementwise multiplication vs. dot product) HOT 1
- Using Activationstats consuming Ram (A lot)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from course22p2.