# simulated batch of images
x = torch.rand(64, 3, 224, 224)
# or some number of layers up the convolutional stack
x = torch.rand(64, 256, 32, 32)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ConcatDataset(Dataset): | |
"""Concatenates a dataset and an iterable of appropriate size.""" | |
def __init__(self, ds, y2): | |
assert(len(ds)==len(y2)) | |
self.ds,self.y2 = ds,y2 | |
def __len__(self): return len(self.ds) | |
def __getitem__(self, i): | |
x,y = self.ds[i] | |
return (x, (self.y2[i],y)) | |
def denorm(self, im): return self.ds.denorm(im) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fire | |
import fastai | |
from fastai.vision import * | |
from torch import nn | |
from fastai.metrics import top_k_accuracy | |
path = untar_data(URLs.CIFAR) | |
data = ImageDataBunch.from_folder(path, valid='test') | |
class block(nn.Module): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastai.vision import * | |
from fastai.script import * | |
from torch import nn | |
from fastai.metrics import top_k_accuracy | |
path = untar_data(URLs.CIFAR) | |
data = ImageDataBunch.from_folder(path, valid='test') | |
class block(nn.Module): | |
def __init__(self, n_in, n_out, two_d=True): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fastai.vision import * | |
from fastai.script import * | |
from torch import nn | |
from fastai.metrics import top_k_accuracy | |
path = untar_data(URLs.CIFAR) | |
data = ImageDataBunch.from_folder(path, valid='test') | |
class block(nn.Module): | |
def __init__(self, n_in, n_out, two_d=True): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from the root of fastcore: | |
python -c "from nbdev.cli import notebook2html; notebook2html()" | |
gem install jekyll bundler # need to have Ruby installed | |
cd docs | |
bundle install |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if after running the below you still experience issues, take a look at the current | |
# docker image definitions here: https://github.com/NVIDIA-Merlin/Merlin/tree/main/docker | |
# (maybe something has changed) | |
sudo apt update -y --fix-missing | |
sudo apt install -y --no-install-recommends libexpat1-dev libsasl2-2 libssl-dev graphviz openssl protobuf-compiler software-properties-common | |
sudo apt autoremove -y | |
sudo apt clean | |
sudo rm -rf /var/lib/apt/lists/* |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer