Skip to content
Snippets Groups Projects
Commit c95dc6af authored by osciban's avatar osciban
Browse files

Archivos TFG

parent 4ef30f42
No related branches found
No related tags found
No related merge requests found
Showing
with 314 additions and 0 deletions
%% Cell type:markdown id:logical-edition tags:
# AlexNet
%% Cell type:code id:early-single tags:
``` python
import fastai
import fastbook
from fastbook import *
from fastai.vision.widgets import *
fastbook.setup_book()
from PIL import Image
```
%% Output
C:\Users\Tottem\.conda\envs\fastai\lib\site-packages\fastbook\__init__.py:18: UserWarning: Missing `graphviz` - please run `conda install fastbook`
except ModuleNotFoundError: warn("Missing `graphviz` - please run `conda install fastbook`")
%% Cell type:code id:final-complaint tags:
``` python
path ='Balones'
```
%% Cell type:code id:becoming-vulnerability tags:
``` python
balls = DataBlock(
blocks=(ImageBlock, CategoryBlock),
get_items=get_image_files,
splitter=RandomSplitter(valid_pct=0.2, seed=42),
get_y=parent_label,
item_tfms=Resize(224))
```
%% Cell type:code id:preceding-locking tags:
``` python
balls = balls.new(item_tfms=Resize(224, ResizeMethod.Pad, pad_mode='zeros'))
dls = balls.dataloaders(path,num_workers=0)
```
%% Cell type:code id:swiss-carry tags:
``` python
dls.valid.show_batch(max_n=4, nrows=1)
```
%% Output
%% Cell type:code id:friendly-israeli tags:
``` python
learn = cnn_learner(dls, alexnet, metrics=error_rate, cbs=CSVLogger("resultados/AlexNet10.csv"))
learn.fine_tune(10)
```
%% Output
%% Cell type:code id:tracked-scratch tags:
``` python
learn.recorder.plot_loss()
```
%% Output
%% Cell type:code id:cross-referral tags:
``` python
interp = ClassificationInterpretation.from_learner(learn)
interp.plot_confusion_matrix()
```
%% Output
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment