This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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) |
NewerOlder