GithubHelp home page GithubHelp logo

fastai / course22p2 Goto Github PK

View Code? Open in Web Editor NEW
430.0 22.0 222.0 101.63 MB

course.fast.ai 2022 part 2

Home Page: https://course.fast.ai/Lessons/part2.html

License: Apache License 2.0

Jupyter Notebook 99.76% CSS 0.01% Python 0.24%

course22p2's Issues

Performance difference in lin_grad function (elementwise multiplication vs. dot product)

In the notebook 03_backprop lin_grad function for calculating gradient of the linear layer, gradient calculation for w.g = (inp.unsqueeze(-1) * out.g.unsqueeze(1)).sum(0) seems to way slower than dot production version w.g = inp.t() @ out.g

Time complexity wise, both seem to have the same: O(m x n x p).

Is the performance gain due to the way both are implemented?

Note: This is not an actual issue, but it confused me a lot because of the huge performance difference in both the implementation; that's the reason I raised this as an issue.

image
image

Using Activationstats consuming Ram (A lot)

Using astats while traning model is consuming memory.

Screenshot from 2024-03-26 12-37-05

  • In the above picture i was traning a resnet model using this callback as the model sees more mini-batches it is comsuming more ram

MetricsCB assumes n_inp=1

I'm playing around with using miniai on different types of tasks. Currently, a siamese network (same/not same) with two input images (and will probably be trying out object detection next which will require multiple y values).

I'm using TrainCB, which allows you to specify n_inp=2. But no support for n_inp > 1 in MetricsCB. I'd be happy to do a pull request but wanted to bounce a few ideas around.

Option 1) just push n_inp into learner and MetricsCB could be modified to honor that
Option 2) add get_x and get_y methods to Learner; TrainCB could patch those (before_fit) for n_inp>1; and MetricsCB would just do *learn.get_y() to evaluate loss

option 1 is probably a reasonable quick workaround for now.
option 2 is a few more changes to the core learner, but probably better?

Thoughts?
Thanks
John

Missing train attribute in WandBCB

In notebook 21, the WandBCB assumes the presence of a train attribute in _log, but this is not present.
A possible fix would be to replace it with d["train"] == "train".

If what I said is correct and you agree with the solution, I can do a PR to fix the bug.

cannot install

Hi, I try to install this repo using the command:
pip install course22p2

but I got the error:
ERROR: Could not find a version that satisfies the requirement course22p2 (from versions: none)
ERROR: No matching distribution found for course22p2

I am using mac and tried to install it in a conda env.

RecorderCB plt not defined error

Hi,

I was trying to use plot from the RecorderCB in miniai/sgd.py, but it gave me plt is not defined error.
Can anyone fix this issue please? I think it just needs matplotlib.pyplot as plt in one of the exported block in the file course22p2/nbs/12_accel_sgd.ipynb.

Thank you.

Release date in sight?

Hi my lovely peoples,
i was just wondering whether there is a specific date for the release of the MOOC already in sight? I am waiting patiently.
Best,
Finn

Notebook 4 - one s too many in the fit function before the random sampling section

Hi,

I was trying to reimplement the course material for my use case which is 1D as homework, and I had a bug running the fit function when using the PyTorch dataloaders, and I noticed that our fit function implemented right before the sampling chapter uses a variable called preds in the report function, however the predictions are stored in pred during the loop, and this lead to me having inconsistent dimensions, removing the s worked out.

Cheers

Two definitions of conv imported in resnet.py

In resnet.py there are (more than) two import *:

from .conv import *
from .init import *

Both contain a conv def. It took me a moment to figure out where the one that was actually used was (given the name I would have said in conv), maybe it would be helpful a refactoring or to avoid the "import *"? I think this is a classic case where import * can lead to unexpected behavior, what do you think?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.