kandi background
Explore Kits

fastbook | The fastai book , published as Jupyter Notebooks | Machine Learning library

 by   fastai Jupyter Notebook Version: 0.0.19 License: GPL-3.0

 by   fastai Jupyter Notebook Version: 0.0.19 License: GPL-3.0

Download this library from

kandi X-RAY | fastbook Summary

fastbook is a Jupyter Notebook library typically used in Artificial Intelligence, Machine Learning, Deep Learning, Pytorch applications. fastbook has no bugs, it has no vulnerabilities, it has a Strong Copyleft License and it has medium support. You can download it from GitHub.
These notebooks cover an introduction to deep learning, fastai, and PyTorch. fastai is a layered API for deep learning; for more information, see the fastai paper. Everything in this repo is copyright Jeremy Howard and Sylvain Gugger, 2020 onwards. These notebooks are used for a MOOC and form the basis of this book, which is currently available for purchase. It does not have the same GPL restrictions that are on this draft. The code in the notebooks and python .py files is covered by the GPL v3 license; see the LICENSE file for details. The remainder (including all markdown cells in the notebooks and other prose) is not licensed for any redistribution or change of format or medium, other than making copies of the notebooks or forking this repo for your own private use. No commercial or broadcast use is allowed. We are making these materials freely available to help you learn deep learning, so please respect our copyright and these restrictions. If you see someone hosting a copy of these materials somewhere else, please let them know that their actions are not allowed and may lead to legal action. Moreover, they would be hurting the community because we're not likely to release additional materials in this way if people ignore our copyright. This is an early draft. If you get stuck running notebooks, please search the fastai-dev forum for answers, and ask for help there if needed. Please don't use GitHub issues for problems running the notebooks. If you make any pull requests to this repo, then you are assigning copyright of that work to Jeremy Howard and Sylvain Gugger. (Additionally, if you are making small edits to spelling or text, please specify the name of the file and a very brief description of what you're fixing. It's difficult for reviewers to know which corrections have already been made. Thank you.).
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • fastbook has a medium active ecosystem.
  • It has 14674 star(s) with 5380 fork(s). There are 478 watchers for this library.
  • There were 2 major release(s) in the last 6 months.
  • There are 56 open issues and 118 have been closed. On average issues are closed in 27 days. There are 43 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of fastbook is 0.0.19
fastbook Support
Best in #Machine Learning
Average in #Machine Learning
fastbook Support
Best in #Machine Learning
Average in #Machine Learning

quality kandi Quality

  • fastbook has 0 bugs and 0 code smells.
fastbook Quality
Best in #Machine Learning
Average in #Machine Learning
fastbook Quality
Best in #Machine Learning
Average in #Machine Learning

securitySecurity

  • fastbook has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • fastbook code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
fastbook Security
Best in #Machine Learning
Average in #Machine Learning
fastbook Security
Best in #Machine Learning
Average in #Machine Learning

license License

  • fastbook is licensed under the GPL-3.0 License. This license is Strong Copyleft.
  • Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.
fastbook License
Best in #Machine Learning
Average in #Machine Learning
fastbook License
Best in #Machine Learning
Average in #Machine Learning

buildReuse

  • fastbook releases are available to install and integrate.
  • Installation instructions are not available. Examples and code snippets are available.
  • It has 99 lines of code, 13 functions and 2 files.
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
fastbook Reuse
Best in #Machine Learning
Average in #Machine Learning
fastbook Reuse
Best in #Machine Learning
Average in #Machine Learning
Top functions reviewed by kandi - BETA

Coming Soon for all Libraries!

Currently covering the most popular Java, JavaScript and Python libraries. See a SAMPLE HERE.
kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.

fastbook Key Features

The fastai book, published as Jupyter Notebooks

Citations

copy iconCopydownload iconDownload
@book{howard2020deep,
title={Deep Learning for Coders with Fastai and Pytorch: AI Applications Without a PhD},
author={Howard, J. and Gugger, S.},
isbn={9781492045526},
url={https://books.google.no/books?id=xd6LxgEACAAJ},
year={2020},
publisher={O'Reilly Media, Incorporated}
}

Fast Ai: AttributeError: 'Learner' object has no attribute 'fine_tune'

copy iconCopydownload iconDownload
from fastai.vision.all import cnn_learner
# rather than
from fastai.vision.learner import cnn_learner

Fast AI pulling a fast one?

copy iconCopydownload iconDownload
In [2]: import fastai.vision.all as fai

In [3]: print(hasattr(learner,'fine_tune'))
True
In [2]: from fastai.callback.schedule import fine_tune

In [3]: print(hasattr(learner,'fine_tune'))
True
-----------------------
In [2]: import fastai.vision.all as fai

In [3]: print(hasattr(learner,'fine_tune'))
True
In [2]: from fastai.callback.schedule import fine_tune

In [3]: print(hasattr(learner,'fine_tune'))
True

pip install options unclear

copy iconCopydownload iconDownload
-q:   hide WARNING messages
-qq:  hide WARNING and ERROR messages
-qqq: hide all messages

Community Discussions

Trending Discussions on fastbook
  • Attribute Error: `loss.backward()` returns None
  • Fast Ai: AttributeError: 'Learner' object has no attribute 'fine_tune'
  • Fast AI pulling a fast one?
  • pip install options unclear
Trending Discussions on fastbook

QUESTION

Attribute Error: `loss.backward()` returns None

Asked 2022-Feb-17 at 18:30

I'm trying to implement the Learner object and its steps and facing an issue with the loss.backward() function as it raises and AttributeError: 'NoneType' object has no attribute 'data'

The entire process works when I follow the Chapter 04 MNIST Basics. However, implementing within a class raises this error. Could anybody guide me on why this occurs and ways to fix this?

Here's the code below:

class Basic_Optim:
    
    def __init__(self, params, lr):
        self.params = list(params)
        self.lr = lr
        
    def step(self):
        for p in self.params:
            p.data -= self.lr * p.grad.data
    
    def zero(self):
        for p in self.params:
            p.grad = None


class Learner_self:
    
    def __init__(self, train, valid, model, loss, metric, params, lr):
        self.x = train
        self.y = valid
        self.model = model
        self.loss = loss
        self.metric = metric
        self.opt_func = Basic_Optim(params, lr)   
        
    def fit(self, epochs):
        for epoch in range(epochs):
            self.train_data()
            score = self.valid_data()
            print(score, end = ' | ')
            
    def train_data(self):
        for x, y in self.x:
            preds = self.model(x)
            loss = self.loss(preds, y)
            loss_b = loss.backward()
            print(f'Loss: {loss:.4f}, Loss Backward: {loss_b}')
            
            self.opt_func.step()
            self.opt_func.zero()
    
    def valid_data(self):
        accuracy = [self.metric(xb, yb) for xb, yb in self.y]
        return round(torch.stack(accuracy).mean().item(), 4)
    
    
learn = Learner_self(dl, valid_dl, simple_net, mnist_loss, metric=batch_accuracy,
                     params=linear_model.parameters(), lr = 1)
learn.fit(10)

OUTPUT from the print statement inside the train_data prints: Loss: 0.0516, Loss Backward: None and then raises the Attribute error shared above.

Please let me know if you want any more details. Every other function such as mnist_loss, batch_accuracy, simple_net are exactly the same from the book. Thank you in advance.

ANSWER

Answered 2022-Feb-17 at 18:30

It seems like your optimizer and your trainer do not work on the same model.
You have model=simple_net, while the parameters for the optimizer are those of a different model params=linear_model.parameters().

Try passing params=simple_net.parameters() -- that is, make sure the trainer's params are those of model.

Source https://stackoverflow.com/questions/71162609

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install fastbook

You can download it from GitHub.

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Share this Page

share link
Compare Machine Learning Libraries with Highest Support
Compare Machine Learning Libraries with Highest Quality
Compare Machine Learning Libraries with Highest Security
Compare Machine Learning Libraries with Permissive License
Compare Machine Learning Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.