SYMBOL INDEX (2028 symbols across 91 files) FILE: deoldify/_device.py class DeviceException (line 7) | class DeviceException(Exception): class _Device (line 10) | class _Device: method __init__ (line 11) | def __init__(self): method is_gpu (line 14) | def is_gpu(self): method current (line 18) | def current(self): method set (line 21) | def set(self, device:DeviceId): FILE: deoldify/augs.py function _noisify (line 6) | def _noisify( FILE: deoldify/critics.py function _conv (line 12) | def _conv(ni: int, nf: int, ks: int = 3, stride: int = 1, **kwargs): function custom_gan_critic (line 16) | def custom_gan_critic( function colorize_crit_learner (line 36) | def colorize_crit_learner( FILE: deoldify/dataset.py function get_colorize_data (line 7) | def get_colorize_data( function get_dummy_databunch (line 42) | def get_dummy_databunch() -> ImageDataBunch: FILE: deoldify/device_id.py class DeviceId (line 3) | class DeviceId(IntEnum): FILE: deoldify/filters.py class IFilter (line 15) | class IFilter(ABC): method filter (line 17) | def filter( class BaseFilter (line 23) | class BaseFilter(IFilter): method __init__ (line 24) | def __init__(self, learn: Learner, stats: tuple = imagenet_stats): method _transform (line 34) | def _transform(self, image: PilImage) -> PilImage: method _scale_to_square (line 37) | def _scale_to_square(self, orig: PilImage, targ: int) -> PilImage: method _get_model_ready_image (line 43) | def _get_model_ready_image(self, orig: PilImage, sz: int) -> PilImage: method _model_process (line 48) | def _model_process(self, orig: PilImage, sz: int) -> PilImage: method _unsquare (line 70) | def _unsquare(self, image: PilImage, orig: PilImage) -> PilImage: class ColorizerFilter (line 76) | class ColorizerFilter(BaseFilter): method __init__ (line 77) | def __init__(self, learn: Learner, stats: tuple = imagenet_stats): method filter (line 81) | def filter( method _transform (line 92) | def _transform(self, image: PilImage) -> PilImage: method _post_process (line 100) | def _post_process(self, raw_color: PilImage, orig: PilImage) -> PilImage: class MasterFilter (line 113) | class MasterFilter(BaseFilter): method __init__ (line 114) | def __init__(self, filters: List[IFilter], render_factor: int): method filter (line 118) | def filter( FILE: deoldify/generators.py function gen_inference_wide (line 12) | def gen_inference_wide( function gen_learner_wide (line 24) | def gen_learner_wide( function unet_learner_wide (line 41) | def unet_learner_wide( function gen_inference_deep (line 85) | def gen_inference_deep( function gen_learner_deep (line 97) | def gen_learner_deep( function unet_learner_deep (line 114) | def unet_learner_deep( FILE: deoldify/layers.py function custom_conv_layer (line 8) | def custom_conv_layer( FILE: deoldify/loss.py class FeatureLoss (line 8) | class FeatureLoss(nn.Module): method __init__ (line 9) | def __init__(self, layer_wgts=[20, 70, 10]): method _make_features (line 26) | def _make_features(self, x, clone=False): method forward (line 30) | def forward(self, input, target): method __del__ (line 42) | def __del__(self): class WassFeatureLoss (line 47) | class WassFeatureLoss(nn.Module): method __init__ (line 48) | def __init__(self, layer_wgts=[5, 15, 2], wass_wgts=[3.0, 0.7, 0.01]): method _make_features (line 69) | def _make_features(self, x, clone=False): method _calc_2_moments (line 73) | def _calc_2_moments(self, tensor): method _get_style_vals (line 85) | def _get_style_vals(self, tensor): method _calc_l2wass_dist (line 95) | def _calc_l2wass_dist( method _single_wass_loss (line 107) | def _single_wass_loss(self, pred, targ): method forward (line 115) | def forward(self, input, target): method __del__ (line 135) | def __del__(self): FILE: deoldify/save.py class GANSaveCallback (line 5) | class GANSaveCallback(LearnerCallback): method __init__ (line 8) | def __init__( method on_batch_end (line 20) | def on_batch_end(self, iteration: int, epoch: int, **kwargs) -> None: method _save_gen_learner (line 27) | def _save_gen_learner(self, iteration: int, epoch: int): FILE: deoldify/unet.py function _get_sfs_idxs (line 13) | def _get_sfs_idxs(sizes: Sizes) -> List[int]: class CustomPixelShuffle_ICNR (line 24) | class CustomPixelShuffle_ICNR(nn.Module): method __init__ (line 27) | def __init__( method forward (line 50) | def forward(self, x): class UnetBlockDeep (line 55) | class UnetBlockDeep(nn.Module): method __init__ (line 58) | def __init__( method forward (line 84) | def forward(self, up_in: Tensor) -> Tensor: class DynamicUnetDeep (line 94) | class DynamicUnetDeep(SequentialEx): method __init__ (line 97) | def __init__( method __del__ (line 164) | def __del__(self): class UnetBlockWide (line 170) | class UnetBlockWide(nn.Module): method __init__ (line 173) | def __init__( method forward (line 198) | def forward(self, up_in: Tensor) -> Tensor: class DynamicUnetWide (line 208) | class DynamicUnetWide(SequentialEx): method __init__ (line 211) | def __init__( method __del__ (line 283) | def __del__(self): FILE: deoldify/visualize.py function get_watermarked (line 20) | def get_watermarked(pil_image: Image) -> Image: class ModelImageVisualizer (line 47) | class ModelImageVisualizer: method __init__ (line 48) | def __init__(self, filter: IFilter, results_dir: str = None): method _clean_mem (line 53) | def _clean_mem(self): method _open_pil_image (line 57) | def _open_pil_image(self, path: Path) -> Image: method _get_image_from_url (line 60) | def _get_image_from_url(self, url: str) -> Image: method plot_transformed_image_from_url (line 65) | def plot_transformed_image_from_url( method plot_transformed_image (line 91) | def plot_transformed_image( method _plot_comparison (line 121) | def _plot_comparison( method _plot_solo (line 145) | def _plot_solo( method _save_result_image (line 161) | def _save_result_image(self, source_path: Path, image: Image, results_... method get_transformed_image (line 168) | def get_transformed_image( method _plot_image (line 183) | def _plot_image( method _get_num_rows_columns (line 204) | def _get_num_rows_columns(self, num_images: int, max_columns: int) -> ... class VideoColorizer (line 211) | class VideoColorizer: method __init__ (line 212) | def __init__(self, vis: ModelImageVisualizer): method _purge_images (line 221) | def _purge_images(self, dir): method _get_ffmpeg_probe (line 226) | def _get_ffmpeg_probe(self, path:Path): method _get_fps (line 239) | def _get_fps(self, source_path: Path) -> str: method _download_video_from_url (line 247) | def _download_video_from_url(self, source_url, source_path: Path): method _extract_raw_frames (line 260) | def _extract_raw_frames(self, source_path: Path): method _colorize_raw_frames (line 286) | def _colorize_raw_frames( method _build_video (line 304) | def _build_video(self, source_path: Path) -> Path: method colorize_from_url (line 373) | def colorize_from_url( method colorize_from_file_name (line 388) | def colorize_from_file_name( method _colorize_from_path (line 396) | def _colorize_from_path( function get_video_colorizer (line 410) | def get_video_colorizer(render_factor: int = 21) -> VideoColorizer: function get_artistic_video_colorizer (line 414) | def get_artistic_video_colorizer( function get_stable_video_colorizer (line 426) | def get_stable_video_colorizer( function get_image_colorizer (line 438) | def get_image_colorizer( function get_stable_image_colorizer (line 447) | def get_stable_image_colorizer( function get_artistic_image_colorizer (line 459) | def get_artistic_image_colorizer( function show_image_in_notebook (line 471) | def show_image_in_notebook(image_path: Path): function show_video_in_notebook (line 475) | def show_video_in_notebook(video_path: Path): FILE: fastai/basic_data.py function intercept_args (line 10) | def intercept_args(self, dataset, batch_size=1, shuffle=False, sampler=N... function DataLoader___getattr__ (line 20) | def DataLoader___getattr__(dl, k:str)->Any: return getattr(dl.dataset, k) function DataLoader___setstate__ (line 23) | def DataLoader___setstate__(dl, data:Any): dl.__dict__.update(data) class DeviceDataLoader (line 27) | class DeviceDataLoader(): method __post_init__ (line 33) | def __post_init__(self): method __len__ (line 37) | def __len__(self)->int: return len(self.dl) method __getattr__ (line 38) | def __getattr__(self,k:str)->Any: return getattr(self.dl, k) method __setstate__ (line 39) | def __setstate__(self,data:Any): self.__dict__.update(data) method batch_size (line 42) | def batch_size(self): return self.dl.batch_size method batch_size (line 44) | def batch_size(self,v): method num_workers (line 50) | def num_workers(self): return self.dl.num_workers method num_workers (line 52) | def num_workers(self,v): self.dl.num_workers = v method add_tfm (line 54) | def add_tfm(self,tfm:Callable)->None: method remove_tfm (line 57) | def remove_tfm(self,tfm:Callable)->None: method new (line 61) | def new(self, **kwargs): method proc_batch (line 67) | def proc_batch(self,b:Tensor)->Tensor: method __iter__ (line 73) | def __iter__(self): method create (line 78) | def create(cls, dataset:Dataset, bs:int=64, shuffle:bool=False, device... class DataBunch (line 84) | class DataBunch(): method __init__ (line 87) | def __init__(self, train_dl:DataLoader, valid_dl:DataLoader, fix_dl:Da... method __repr__ (line 102) | def __repr__(self)->str: method _init_ds (line 106) | def _init_ds(train_ds:Dataset, valid_ds:Dataset, test_ds:Optional[Data... method create (line 112) | def create(cls, train_ds:Dataset, valid_ds:Dataset, test_ds:Optional[D... method __getattr__ (line 122) | def __getattr__(self,k:int)->Any: return getattr(self.train_dl, k) method __setstate__ (line 123) | def __setstate__(self,data:Any): self.__dict__.update(data) method dl (line 125) | def dl(self, ds_type:DatasetType=DatasetType.Valid)->DeviceDataLoader: method dls (line 135) | def dls(self)->List[DeviceDataLoader]: method add_tfm (line 143) | def add_tfm(self,tfm:Callable)->None: method remove_tfm (line 146) | def remove_tfm(self,tfm:Callable)->None: method save (line 149) | def save(self, file:PathLikeOrBinaryStream= 'data_save.pkl')->None: method add_test (line 156) | def add_test(self, items:Iterator, label:Any=None, tfms=None, tfm_y=No... method one_batch (line 163) | def one_batch(self, ds_type:DatasetType=DatasetType.Train, detach:bool... method one_item (line 177) | def one_item(self, item, detach:bool=False, denorm:bool=False, cpu:boo... method show_batch (line 183) | def show_batch(self, rows:int=5, ds_type:DatasetType=DatasetType.Train... method export (line 196) | def export(self, file:PathLikeOrBinaryStream='export.pkl'): method _grab_dataset (line 201) | def _grab_dataset(self, dl:DataLoader): method train_ds (line 207) | def train_ds(self)->Dataset: return self._grab_dataset(self.train_dl) method valid_ds (line 209) | def valid_ds(self)->Dataset: return self._grab_dataset(self.valid_dl) method single_ds (line 211) | def single_ds(self)->Dataset: return self._grab_dataset(self.single_dl) method loss_func (line 213) | def loss_func(self)->OptLossFunc: method test_ds (line 217) | def test_ds(self)->Dataset: method empty_val (line 221) | def empty_val(self)->bool: method is_empty (line 227) | def is_empty(self)->bool: method batch_size (line 233) | def batch_size(self): return self.train_dl.batch_size method batch_size (line 235) | def batch_size(self,v): method sanity_check (line 239) | def sanity_check(self): function load_data (line 272) | def load_data(path:PathOrStr, file:PathLikeOrBinaryStream='data_save.pkl... FILE: fastai/basic_train.py function loss_batch (line 20) | def loss_batch(model:nn.Module, xb:Tensor, yb:Tensor, loss_func:OptLossF... function get_preds (line 43) | def get_preds(model:nn.Module, dl:DataLoader, pbar:Optional[PBar]=None, ... function validate (line 53) | def validate(model:nn.Module, dl:DataLoader, loss_func:OptLossFunc=None,... function train_epoch (line 72) | def train_epoch(model:nn.Module, dl:DataLoader, opt:optim.Optimizer, los... class BasicLearner (line 82) | class BasicLearner(): function fit (line 88) | def fit(epochs:int, learn:BasicLearner, callbacks:Optional[CallbackList]... function _loss_func_name2activ (line 123) | def _loss_func_name2activ(name:str, axis:int=-1): function _loss_func2activ (line 128) | def _loss_func2activ(loss_func): class Learner (line 148) | class Learner(): method __post_init__ (line 166) | def __post_init__(self)->None: method init (line 177) | def init(self, init): apply_init(self.model, init) method _test_writeable_path (line 179) | def _test_writeable_path(self): method lr_range (line 188) | def lr_range(self, lr:Union[float,slice])->np.ndarray: method fit (line 195) | def fit(self, epochs:int, lr:Union[Floats,slice]=defaults.lr, method create_opt (line 206) | def create_opt(self, lr:Floats, wd:Floats=0.)->None: method split (line 210) | def split(self, split_on:SplitFuncOrIdxList)->None: method freeze_to (line 216) | def freeze_to(self, n:int)->None: method freeze (line 224) | def freeze(self)->None: method unfreeze (line 229) | def unfreeze(self): method export (line 233) | def export(self, file:PathLikeOrBinaryStream='export.pkl', destroy=Fal... method save (line 249) | def save(self, file:PathLikeOrBinaryStream=None, return_path:bool=Fals... method dl (line 260) | def dl(self, ds_type:DatasetType=DatasetType.Valid): method load (line 264) | def load(self, file:PathLikeOrBinaryStream=None, device:torch.device=N... method destroy (line 288) | def destroy(self): method purge (line 305) | def purge(self, clear_opt:bool=True): method get_preds (line 335) | def get_preds(self, ds_type:DatasetType=DatasetType.Valid, with_loss:b... method pred_batch (line 342) | def pred_batch(self, ds_type:DatasetType=DatasetType.Valid, batch:Tupl... method backward (line 365) | def backward(self, item): method predict (line 372) | def predict(self, item:ItemBase, return_x:bool=False, batch_first:bool... method validate (line 387) | def validate(self, dl=None, callbacks=None, metrics=None): method show_results (line 397) | def show_results(self, ds_type=DatasetType.Valid, rows:int=5, **kwargs): method apply_dropout (line 425) | def apply_dropout(self, m): method predict_with_mc_dropout (line 429) | def predict_with_mc_dropout(self, item:ItemBase, with_dropout:bool=Tru... class RecordOnCPU (line 433) | class RecordOnCPU(Callback): method on_batch_begin (line 435) | def on_batch_begin(self, last_input,last_target,**kwargs): class LearnerCallback (line 438) | class LearnerCallback(Callback): method __init__ (line 440) | def __init__(self, learn): method __getattr__ (line 445) | def __getattr__(self,k): return getattr(self.learn, k) method __setstate__ (line 446) | def __setstate__(self,data:Any): self.__dict__.update(data) method learn (line 449) | def learn(self) -> Learner: return self._learn() method learn (line 451) | def learn(self, learn: Learner) -> None: self._learn = weakref.ref(learn) method cb_name (line 454) | def cb_name(self): return camel2snake(self.__class__.__name__) class Recorder (line 456) | class Recorder(LearnerCallback): method __init__ (line 459) | def __init__(self, learn:Learner, add_time:bool=True, silent:bool=False): method on_train_begin (line 465) | def on_train_begin(self, pbar:PBar, metrics_names:Collection[str], **k... method on_epoch_begin (line 476) | def on_epoch_begin(self, **kwargs:Any)->None: method on_batch_begin (line 479) | def on_batch_begin(self, train, **kwargs:Any)->None: method on_backward_begin (line 485) | def on_backward_begin(self, smooth_loss:Tensor, **kwargs:Any)->None: method on_epoch_end (line 491) | def on_epoch_end(self, epoch:int, num_batch:int, smooth_loss:Tensor, method format_stats (line 500) | def format_stats(self, stats:TensorOrNumList)->None: method add_metric_names (line 508) | def add_metric_names(self, names): method plot_lr (line 513) | def plot_lr(self, show_moms=False, skip_start:int=0, skip_end:int=0, r... method smoothen_by_spline (line 535) | def smoothen_by_spline(xs, ys, **kwargs): method plot (line 541) | def plot(self, skip_start:int=10, skip_end:int=5, suggestion:bool=Fals... method plot_losses (line 567) | def plot_losses(self, skip_start:int=0, skip_end:int=0, return_fig:boo... method plot_metrics (line 582) | def plot_metrics(self, skip_start:int=0, skip_end:int=0, return_fig:bo... method _split_list (line 597) | def _split_list(self, vals:Collection[float], skip_start:int, skip_end... method _split_list_val (line 600) | def _split_list_val(self, vals:Collection[float], skip_start:int, skip... class FakeOptimizer (line 606) | class FakeOptimizer(): method step (line 607) | def step(self): pass method zero_grad (line 608) | def zero_grad(self): pass function load_callback (line 610) | def load_callback(class_func, state, learn:Learner): function load_learner (line 616) | def load_learner(path:PathOrStr, file:PathLikeOrBinaryStream='export.pkl... FILE: fastai/callback.py class OptimWrapper (line 9) | class OptimWrapper(): method __init__ (line 11) | def __init__(self, opt:optim.Optimizer, wd:Floats=0., true_wd:bool=Fal... method create (line 20) | def create(cls, opt_func:Union[type,Callable], lr:Union[float,Tuple,Li... method new (line 29) | def new(self, layer_groups:Collection[nn.Module], split_no_wd:bool=True): method new_with_params (line 36) | def new_with_params(self, param_groups:Collection[Collection[nn.Parame... method __repr__ (line 44) | def __repr__(self)->str: method step (line 48) | def step(self)->None: method zero_grad (line 59) | def zero_grad(self)->None: method __getattr__ (line 64) | def __getattr__(self, k:str)->Any: return getattr(self.opt, k, None) method __setstate__ (line 65) | def __setstate__(self,data:Any): self.__dict__.update(data) method clear (line 67) | def clear(self): method n_params (line 74) | def n_params(self): return sum([len(pg['params']) for pg in self.opt.p... method lr (line 78) | def lr(self)->float: return self._lr[-1] method lr (line 80) | def lr(self, val:float)->None: method mom (line 84) | def mom(self)->float:return self._mom[-1] method mom (line 86) | def mom(self, val:float)->None: method beta (line 92) | def beta(self)->float: return None if self._beta is None else self._be... method beta (line 94) | def beta(self, val:float)->None: method wd (line 102) | def wd(self)->float: return self._wd[-1] method wd (line 104) | def wd(self, val:float)->None: method read_defaults (line 110) | def read_defaults(self)->None: method get_stat (line 122) | def get_stat(self, name:str)->float: method set_stat (line 125) | def set_stat(self, name:str, value:Union[float, Collection[float]])->N... method set_val (line 132) | def set_val(self, key:str, val:Any, bn_groups:bool=True)->Any: method read_val (line 140) | def read_val(self, key:str) -> Union[List[float],Tuple[List[float],Lis... method get_state (line 146) | def get_state(self): method load_with_state_and_layer_group (line 152) | def load_with_state_and_layer_group(cls, state:dict, layer_groups:Coll... class Callback (line 159) | class Callback(): method on_train_begin (line 162) | def on_train_begin(self, **kwargs:Any)->None: method on_epoch_begin (line 165) | def on_epoch_begin(self, **kwargs:Any)->None: method on_batch_begin (line 168) | def on_batch_begin(self, **kwargs:Any)->None: method on_loss_begin (line 171) | def on_loss_begin(self, **kwargs:Any)->None: method on_backward_begin (line 174) | def on_backward_begin(self, **kwargs:Any)->None: method on_backward_end (line 177) | def on_backward_end(self, **kwargs:Any)->None: method on_step_end (line 180) | def on_step_end(self, **kwargs:Any)->None: method on_batch_end (line 183) | def on_batch_end(self, **kwargs:Any)->None: method on_epoch_end (line 186) | def on_epoch_end(self, **kwargs:Any)->None: method on_train_end (line 189) | def on_train_end(self, **kwargs:Any)->None: method jump_to_epoch (line 192) | def jump_to_epoch(self, epoch)->None: method get_state (line 196) | def get_state(self, minimal:bool=True): method __repr__ (line 202) | def __repr__(self): class SmoothenValue (line 208) | class SmoothenValue(): method __init__ (line 210) | def __init__(self, beta:float): method add_value (line 213) | def add_value(self, val:float)->None: function _get_init_state (line 221) | def _get_init_state(): return {'epoch':0, 'iteration':0, 'num_batch':0, ... class CallbackHandler (line 224) | class CallbackHandler(): method __post_init__ (line 230) | def __post_init__(self)->None: method _call_and_update (line 239) | def _call_and_update(self, cb, cb_name, **kwargs)->None: method __call__ (line 247) | def __call__(self, cb_name, call_mets=True, **kwargs)->None: method set_dl (line 253) | def set_dl(self, dl:DataLoader): method on_train_begin (line 260) | def on_train_begin(self, epochs:int, pbar:PBar, metrics:MetricFuncList... method on_epoch_begin (line 270) | def on_epoch_begin(self)->None: method on_batch_begin (line 275) | def on_batch_begin(self, xb:Tensor, yb:Tensor, train:bool=True)->Tuple... method on_loss_begin (line 282) | def on_loss_begin(self, out:Tensor)->Any: method on_backward_begin (line 288) | def on_backward_begin(self, loss:Tensor)->Tuple[Any,Any]: method on_backward_end (line 295) | def on_backward_end(self)->Any: method on_step_end (line 300) | def on_step_end(self)->Any: method on_batch_end (line 305) | def on_batch_end(self, loss:Tensor)->Any: method on_epoch_end (line 314) | def on_epoch_end(self, val_loss:Tensor)->bool: method on_train_end (line 321) | def on_train_end(self, exception:Union[bool,Exception])->None: method skip_validate (line 326) | def skip_validate(self): return self.state_dict['skip_validate'] class AverageMetric (line 328) | class AverageMetric(Callback): method __init__ (line 330) | def __init__(self, func): method on_epoch_begin (line 336) | def on_epoch_begin(self, **kwargs): method on_batch_end (line 340) | def on_batch_end(self, last_output, last_target, **kwargs): method on_epoch_end (line 351) | def on_epoch_end(self, last_metrics, **kwargs): function annealing_no (line 355) | def annealing_no(start:Number, end:Number, pct:float)->Number: function annealing_linear (line 358) | def annealing_linear(start:Number, end:Number, pct:float)->Number: function annealing_exp (line 361) | def annealing_exp(start:Number, end:Number, pct:float)->Number: function annealing_cos (line 364) | def annealing_cos(start:Number, end:Number, pct:float)->Number: function do_annealing_poly (line 369) | def do_annealing_poly(start:Number, end:Number, pct:float, degree:Number... function annealing_poly (line 372) | def annealing_poly(degree:Number)->Number: class Scheduler (line 376) | class Scheduler(): method __init__ (line 378) | def __init__(self, vals:StartOptEnd, n_iter:int, func:Optional[AnnealF... method restart (line 385) | def restart(self): self.n = 0 method step (line 387) | def step(self)->Number: method is_done (line 393) | def is_done(self)->bool: FILE: fastai/callbacks/csv_logger.py class CSVLogger (line 12) | class CSVLogger(LearnerCallback): method __init__ (line 14) | def __init__(self, learn:Learner, filename: str = 'history', append: b... method read_logged_file (line 19) | def read_logged_file(self): method on_train_begin (line 23) | def on_train_begin(self, **kwargs: Any) -> None: method on_epoch_begin (line 29) | def on_epoch_begin(self, **kwargs:Any)->None: method on_epoch_end (line 32) | def on_epoch_end(self, epoch: int, smooth_loss: Tensor, last_metrics: ... method on_train_end (line 41) | def on_train_end(self, **kwargs: Any) -> None: FILE: fastai/callbacks/fp16.py function get_master (line 10) | def get_master(layer_groups:ModuleList, flat_master:bool=False) -> Tuple... function model_g2master_g (line 30) | def model_g2master_g(model_params:Sequence[Tensor], master_params:Sequen... function master2model (line 45) | def master2model(model_params:Sequence[Tensor], master_params:Sequence[T... function grad_overflow (line 56) | def grad_overflow(param_group): class MixedPrecision (line 64) | class MixedPrecision(LearnerCallback): method __init__ (line 67) | def __init__(self, learn:Learner, loss_scale:float=None, max_noskip:in... method on_train_begin (line 76) | def on_train_begin(self, **kwargs:Any)->None: method on_loss_begin (line 88) | def on_loss_begin(self, last_output:Tensor, **kwargs:Any) -> Tensor: method on_backward_begin (line 92) | def on_backward_begin(self, last_loss:Rank0Tensor, **kwargs:Any) -> Ra... method on_backward_end (line 98) | def on_backward_end(self, **kwargs:Any)->None: method on_step_end (line 117) | def on_step_end(self, **kwargs:Any)->None: FILE: fastai/callbacks/general_sched.py class TrainingPhase (line 8) | class TrainingPhase(): method __post_init__ (line 12) | def __post_init__(self): self.scheds = dict() method schedule_hp (line 13) | def schedule_hp(self, name, vals, anneal=None): class GeneralScheduler (line 18) | class GeneralScheduler(LearnerCallback): method __init__ (line 20) | def __init__(self, learn:Learner, phases:Collection[TrainingPhase], st... method on_train_begin (line 24) | def on_train_begin(self, epoch:int, **kwargs:Any)->None: method jump_to_epoch (line 36) | def jump_to_epoch(self, epoch:int)->None: method on_batch_end (line 40) | def on_batch_end(self, train, **kwargs:Any)->None: FILE: fastai/callbacks/hooks.py class Hook (line 10) | class Hook(): method __init__ (line 12) | def __init__(self, m:nn.Module, hook_func:HookFunc, is_forward:bool=Tr... method hook_fn (line 18) | def hook_fn(self, module:nn.Module, input:Tensors, output:Tensors): method remove (line 25) | def remove(self): method __enter__ (line 31) | def __enter__(self, *args): return self method __exit__ (line 32) | def __exit__(self, *args): self.remove() class Hooks (line 34) | class Hooks(): method __init__ (line 36) | def __init__(self, ms:Collection[nn.Module], hook_func:HookFunc, is_fo... method __getitem__ (line 39) | def __getitem__(self,i:int)->Hook: return self.hooks[i] method __len__ (line 40) | def __len__(self)->int: return len(self.hooks) method __iter__ (line 41) | def __iter__(self): return iter(self.hooks) method stored (line 43) | def stored(self): return [o.stored for o in self] method remove (line 45) | def remove(self): method __enter__ (line 49) | def __enter__(self, *args): return self method __exit__ (line 50) | def __exit__ (self, *args): self.remove() function _hook_inner (line 52) | def _hook_inner(m,i,o): return o if isinstance(o,Tensor) else o if is_li... function hook_output (line 54) | def hook_output (module:nn.Module, detach:bool=True, grad:bool=False)->H... function hook_outputs (line 58) | def hook_outputs(modules:Collection[nn.Module], detach:bool=True, grad:b... class HookCallback (line 62) | class HookCallback(LearnerCallback): method __init__ (line 64) | def __init__(self, learn:Learner, modules:Sequence[nn.Module]=None, do... method on_train_begin (line 68) | def on_train_begin(self, **kwargs): method on_train_end (line 75) | def on_train_end(self, **kwargs): method remove (line 79) | def remove(self): method __del__ (line 81) | def __del__(self): self.remove() class ActivationStats (line 83) | class ActivationStats(HookCallback): method on_train_begin (line 86) | def on_train_begin(self, **kwargs): method hook (line 91) | def hook(self, m:nn.Module, i:Tensors, o:Tensors)->Tuple[Rank0Tensor,R... method on_batch_end (line 94) | def on_batch_end(self, train, **kwargs): method on_train_end (line 97) | def on_train_end(self, **kwargs): function dummy_batch (line 102) | def dummy_batch(m: nn.Module, size:tuple=(64,64))->Tensor: function dummy_eval (line 107) | def dummy_eval(m:nn.Module, size:tuple=(64,64)): function model_sizes (line 113) | def model_sizes(m:nn.Module, size:tuple=(64,64))->Tuple[Sizes,Tensor,Hoo... function num_features_model (line 119) | def num_features_model(m:nn.Module)->int: function total_params (line 128) | def total_params(m:nn.Module)->int: function hook_params (line 136) | def hook_params(modules:Collection[nn.Module])->Hooks: function params_size (line 139) | def params_size(m: Union[nn.Module,Learner], size: tuple = (3, 64, 64))-... function get_layer_name (line 158) | def get_layer_name(layer:nn.Module)->str: function layers_info (line 161) | def layers_info(m:Collection[nn.Module]) -> Collection[namedtuple]: function model_summary (line 168) | def model_summary(m:Learner, n:int=70): FILE: fastai/callbacks/loss_metrics.py class LossMetrics (line 7) | class LossMetrics(LearnerCallback): method on_train_begin (line 11) | def on_train_begin(self, **kwargs): method on_epoch_begin (line 17) | def on_epoch_begin(self, **kwargs): method on_batch_end (line 22) | def on_batch_end(self, last_target, train, **kwargs): method on_epoch_end (line 30) | def on_epoch_end(self, last_metrics, **kwargs): FILE: fastai/callbacks/lr_finder.py class LRFinder (line 9) | class LRFinder(LearnerCallback): method __init__ (line 11) | def __init__(self, learn:Learner, start_lr:float=1e-7, end_lr:float=10... method on_train_begin (line 16) | def on_train_begin(self, pbar, **kwargs:Any)->None: method on_batch_end (line 25) | def on_batch_end(self, iteration:int, smooth_loss:TensorOrNumber, **kw... method on_train_end (line 33) | def on_train_end(self, **kwargs:Any)->None: FILE: fastai/callbacks/mem.py class PeakMemMetric (line 11) | class PeakMemMetric(LearnerCallback): method __init__ (line 16) | def __init__(self, learn:Learner): method peak_monitor_start (line 21) | def peak_monitor_start(self): method peak_monitor_stop (line 32) | def peak_monitor_stop(self): method peak_monitor_func (line 36) | def peak_monitor_func(self): method on_train_begin (line 48) | def on_train_begin(self, **kwargs): method on_epoch_begin (line 51) | def on_epoch_begin(self, **kwargs): method on_epoch_end (line 55) | def on_epoch_end(self, last_metrics, **kwargs): FILE: fastai/callbacks/misc.py class StopAfterNBatches (line 5) | class StopAfterNBatches(Callback): method __init__ (line 7) | def __init__(self, n_batches:int=2): method on_batch_end (line 10) | def on_batch_end(self, iteration, **kwargs): FILE: fastai/callbacks/mixup.py class MixUpCallback (line 6) | class MixUpCallback(LearnerCallback): method __init__ (line 8) | def __init__(self, learn:Learner, alpha:float=0.4, stack_x:bool=False,... method on_train_begin (line 12) | def on_train_begin(self, **kwargs): method on_batch_begin (line 15) | def on_batch_begin(self, last_input, last_target, train, **kwargs): method on_train_end (line 36) | def on_train_end(self, **kwargs): class MixUpLoss (line 40) | class MixUpLoss(Module): method __init__ (line 43) | def __init__(self, crit, reduction='mean'): method forward (line 54) | def forward(self, output, target): method get_old (line 63) | def get_old(self): FILE: fastai/callbacks/mlflow.py class MLFlowTracker (line 9) | class MLFlowTracker(LearnerCallback): method __init__ (line 11) | def __init__(self, learn:Learner, exp_name: str, params: dict, nb_path... method on_train_begin (line 16) | def on_train_begin(self, **kwargs: Any) -> None: method on_epoch_end (line 26) | def on_epoch_end(self, epoch, **kwargs:Any)->None: method on_train_end (line 33) | def on_train_end(self, **kwargs: Any) -> None: FILE: fastai/callbacks/one_cycle.py class OneCycleScheduler (line 8) | class OneCycleScheduler(LearnerCallback): method __init__ (line 10) | def __init__(self, learn:Learner, lr_max:float, moms:Floats=(0.95,0.85... method steps (line 19) | def steps(self, *steps_cfg:StartOptEnd): method on_train_begin (line 24) | def on_train_begin(self, n_epochs:int, epoch:int, **kwargs:Any)->None: method jump_to_epoch (line 41) | def jump_to_epoch(self, epoch:int)->None: method on_batch_end (line 45) | def on_batch_end(self, train, **kwargs:Any)->None: method on_epoch_end (line 56) | def on_epoch_end(self, epoch, **kwargs:Any)->None: FILE: fastai/callbacks/oversampling.py class OverSamplingCallback (line 11) | class OverSamplingCallback(LearnerCallback): method __init__ (line 12) | def __init__(self,learn:Learner,weights:torch.Tensor=None): method on_train_begin (line 21) | def on_train_begin(self, **kwargs): FILE: fastai/callbacks/rnn.py class RNNTrainer (line 8) | class RNNTrainer(LearnerCallback): method __init__ (line 10) | def __init__(self, learn:Learner, alpha:float=0., beta:float=0.): method on_epoch_begin (line 15) | def on_epoch_begin(self, **kwargs): method on_loss_begin (line 19) | def on_loss_begin(self, last_output:Tuple[Tensor,Tensor,Tensor], **kwa... method on_backward_begin (line 24) | def on_backward_begin(self, last_loss:Rank0Tensor, last_input:Tensor, ... FILE: fastai/callbacks/tensorboard.py class LearnerTensorboardWriter (line 26) | class LearnerTensorboardWriter(LearnerCallback): method __init__ (line 28) | def __init__(self, learn:Learner, base_dir:Path, name:str, loss_iters:... method _get_new_batch (line 40) | def _get_new_batch(self, ds_type:DatasetType)->Collection[Tensor]: method _update_batches_if_needed (line 44) | def _update_batches_if_needed(self)->None: method _write_model_stats (line 53) | def _write_model_stats(self, iteration:int)->None: method _write_training_loss (line 57) | def _write_training_loss(self, iteration:int, last_loss:Tensor)->None: method _write_weight_histograms (line 63) | def _write_weight_histograms(self, iteration:int)->None: method _write_scalar (line 67) | def _write_scalar(self, name:str, scalar_value, iteration:int)->None: method _write_metrics (line 73) | def _write_metrics(self, iteration:int, last_metrics:MetricsList, star... method on_train_begin (line 81) | def on_train_begin(self, **kwargs: Any) -> None: method on_batch_end (line 86) | def on_batch_end(self, last_loss:Tensor, iteration:int, **kwargs)->None: method on_backward_end (line 94) | def on_backward_end(self, iteration:int, **kwargs)->None: method on_epoch_end (line 100) | def on_epoch_end(self, last_metrics:MetricsList, iteration:int, **kwar... class GANTensorboardWriter (line 105) | class GANTensorboardWriter(LearnerTensorboardWriter): method __init__ (line 107) | def __init__(self, learn:GANLearner, base_dir:Path, name:str, loss_ite... method _write_weight_histograms (line 115) | def _write_weight_histograms(self, iteration:int)->None: method _write_gen_model_stats (line 121) | def _write_gen_model_stats(self, iteration:int)->None: method _write_critic_model_stats (line 127) | def _write_critic_model_stats(self, iteration:int)->None: method _write_model_stats (line 133) | def _write_model_stats(self, iteration:int)->None: method _write_training_loss (line 140) | def _write_training_loss(self, iteration:int, last_loss:Tensor)->None: method _write_images (line 148) | def _write_images(self, iteration:int)->None: method on_batch_end (line 159) | def on_batch_end(self, iteration:int, **kwargs)->None: method on_backward_end (line 165) | def on_backward_end(self, iteration:int, **kwargs)->None: class ImageGenTensorboardWriter (line 174) | class ImageGenTensorboardWriter(LearnerTensorboardWriter): method __init__ (line 176) | def __init__(self, learn:Learner, base_dir:Path, name:str, loss_iters:... method _write_images (line 183) | def _write_images(self, iteration:int)->None: method on_batch_end (line 188) | def on_batch_end(self, iteration:int, **kwargs)->None: class TBWriteRequest (line 195) | class TBWriteRequest(ABC): method __init__ (line 197) | def __init__(self, tbwriter: SummaryWriter, iteration:int): method write (line 203) | def write(self)->None: pass class AsyncTBWriter (line 209) | class AsyncTBWriter(): method __init__ (line 211) | def __init__(self): method request_write (line 218) | def request_write(self, request: TBWriteRequest)->None: method _queue_processor (line 223) | def _queue_processor(self)->None: method close (line 234) | def close(self)->None: method __enter__ (line 241) | def __enter__(self): pass method __exit__ (line 243) | def __exit__(self, exc_type, exc_value, traceback): self.close() class ModelImageSet (line 247) | class ModelImageSet(): method get_list_from_model (line 250) | def get_list_from_model(learn:Learner, ds_type:DatasetType, batch:Tupl... method __init__ (line 262) | def __init__(self, orig:Image, real:Image, gen:Image): self.orig, self... class HistogramTBRequest (line 264) | class HistogramTBRequest(TBWriteRequest): method __init__ (line 266) | def __init__(self, model:nn.Module, iteration:int, tbwriter:SummaryWri... method _write_histogram (line 271) | def _write_histogram(self, param_name:str, values)->None: method write (line 276) | def write(self)->None: class HistogramTBWriter (line 281) | class HistogramTBWriter(): method __init__ (line 283) | def __init__(self): super().__init__() method write (line 285) | def write(self, model:nn.Module, iteration:int, tbwriter:SummaryWriter... class ModelStatsTBRequest (line 290) | class ModelStatsTBRequest(TBWriteRequest): method __init__ (line 292) | def __init__(self, model:nn.Module, iteration:int, tbwriter:SummaryWri... method _add_gradient_scalar (line 297) | def _add_gradient_scalar(self, name:str, scalar_value)->None: method _write_avg_norm (line 302) | def _write_avg_norm(self, norms:[])->None: method _write_median_norm (line 307) | def _write_median_norm(self, norms:[])->None: method _write_max_norm (line 312) | def _write_max_norm(self, norms:[])->None: method _write_min_norm (line 317) | def _write_min_norm(self, norms:[])->None: method _write_num_zeros (line 322) | def _write_num_zeros(self)->None: method _write_avg_gradient (line 328) | def _write_avg_gradient(self)->None: method _write_median_gradient (line 333) | def _write_median_gradient(self)->None: method _write_max_gradient (line 338) | def _write_max_gradient(self)->None: method _write_min_gradient (line 343) | def _write_min_gradient(self)->None: method write (line 348) | def write(self)->None: class ModelStatsTBWriter (line 362) | class ModelStatsTBWriter(): method write (line 364) | def write(self, model:nn.Module, iteration:int, tbwriter:SummaryWriter... class ImageTBRequest (line 369) | class ImageTBRequest(TBWriteRequest): method __init__ (line 371) | def __init__(self, learn:Learner, batch:Tuple, iteration:int, tbwriter... method _write_images (line 376) | def _write_images(self, name:str, images:[Tensor])->None: method _get_image_tensors (line 381) | def _get_image_tensors(self)->([Tensor], [Tensor], [Tensor]): method write (line 390) | def write(self)->None: class ImageTBWriter (line 398) | class ImageTBWriter(): method __init__ (line 400) | def __init__(self): super().__init__() method write (line 402) | def write(self, learn:Learner, trn_batch:Tuple, val_batch:Tuple, itera... method _write_for_dstype (line 407) | def _write_for_dstype(self, learn:Learner, batch:Tuple, iteration:int,... class GraphTBRequest (line 412) | class GraphTBRequest(TBWriteRequest): method __init__ (line 414) | def __init__(self, model:nn.Module, tbwriter:SummaryWriter, input_to_m... method write (line 418) | def write(self)->None: class GraphTBWriter (line 422) | class GraphTBWriter(): method write (line 424) | def write(self, model:nn.Module, tbwriter:SummaryWriter, input_to_mode... FILE: fastai/callbacks/tracker.py class TerminateOnNaNCallback (line 10) | class TerminateOnNaNCallback(Callback): method __init__ (line 13) | def __init__(self): method on_batch_end (line 16) | def on_batch_end(self, last_loss, epoch, num_batch, **kwargs:Any)->None: class TrackerCallback (line 23) | class TrackerCallback(LearnerCallback): method __init__ (line 25) | def __init__(self, learn:Learner, monitor:str='valid_loss', mode:str='... method on_train_begin (line 35) | def on_train_begin(self, **kwargs:Any)->None: method get_monitor_value (line 39) | def get_monitor_value(self): class EarlyStoppingCallback (line 53) | class EarlyStoppingCallback(TrackerCallback): method __init__ (line 55) | def __init__(self, learn:Learner, monitor:str='valid_loss', mode:str='... method on_train_begin (line 60) | def on_train_begin(self, **kwargs:Any)->None: method on_epoch_end (line 65) | def on_epoch_end(self, epoch, **kwargs:Any)->None: class SaveModelCallback (line 77) | class SaveModelCallback(TrackerCallback): method __init__ (line 79) | def __init__(self, learn:Learner, monitor:str='valid_loss', mode:str='... method jump_to_epoch (line 86) | def jump_to_epoch(self, epoch:int)->None: method on_epoch_end (line 92) | def on_epoch_end(self, epoch:int, **kwargs:Any)->None: method on_train_end (line 102) | def on_train_end(self, **kwargs): class ReduceLROnPlateauCallback (line 107) | class ReduceLROnPlateauCallback(TrackerCallback): method __init__ (line 109) | def __init__(self, learn:Learner, monitor:str='valid_loss', mode:str='... method on_train_begin (line 115) | def on_train_begin(self, **kwargs:Any)->None: method on_epoch_end (line 120) | def on_epoch_end(self, epoch, **kwargs:Any)->None: class TrackEpochCallback (line 133) | class TrackEpochCallback(LearnerCallback): method __init__ (line 135) | def __init__(self, learn:Learner, name:str='epoch', epoch_offset:int=N... method on_train_begin (line 147) | def on_train_begin(self, **kwargs:Any): method on_epoch_end (line 150) | def on_epoch_end(self, epoch, **kwargs:Any)->None: method restart (line 153) | def restart(self): os.remove(self.path) FILE: fastai/collab.py class CollabProcessor (line 8) | class CollabProcessor(TabularProcessor): method process_one (line 10) | def process_one(self, item): class CollabLine (line 14) | class CollabLine(TabularLine): method __init__ (line 16) | def __init__(self, cats, conts, classes, names): class CollabList (line 20) | class CollabList(TabularList): method reconstruct (line 24) | def reconstruct(self, t:Tensor): return CollabLine(tensor(t), tensor([... class EmbeddingNN (line 26) | class EmbeddingNN(TabularModel): method __init__ (line 28) | def __init__(self, emb_szs:ListSizes, layers:Collection[int]=None, ps:... method forward (line 33) | def forward(self, users:LongTensor, items:LongTensor) -> Tensor: class EmbeddingDotBias (line 36) | class EmbeddingDotBias(Module): method __init__ (line 38) | def __init__(self, n_factors:int, n_users:int, n_items:int, y_range:Tu... method forward (line 44) | def forward(self, users:LongTensor, items:LongTensor) -> Tensor: class CollabDataBunch (line 50) | class CollabDataBunch(DataBunch): method from_df (line 53) | def from_df(cls, ratings:DataFrame, valid_pct:float=0.2, user_name:Opt... class CollabLearner (line 68) | class CollabLearner(Learner): method get_idx (line 70) | def get_idx(self, arr:Collection, is_item:bool=True): method bias (line 82) | def bias(self, arr:Collection, is_item:bool=True): method weight (line 89) | def weight(self, arr:Collection, is_item:bool=True): function collab_learner (line 96) | def collab_learner(data, n_factors:int=None, use_nn:bool=False, emb_szs:... FILE: fastai/core.py function num_cpus (line 43) | def num_cpus()->int: function is_listy (line 51) | def is_listy(x:Any)->bool: return isinstance(x, (tuple,list)) function is_tuple (line 52) | def is_tuple(x:Any)->bool: return isinstance(x, tuple) function is_dict (line 53) | def is_dict(x:Any)->bool: return isinstance(x, dict) function is_pathlike (line 54) | def is_pathlike(x:Any)->bool: return isinstance(x, (str,Path)) function noop (line 55) | def noop(x): return x class PrePostInitMeta (line 57) | class PrePostInitMeta(type): method __new__ (line 59) | def __new__(cls, name, bases, dct): function chunks (line 73) | def chunks(l:Collection, n:int)->Iterable: function recurse (line 77) | def recurse(func:Callable, x:Any, *args, **kwargs)->Any: function first_el (line 82) | def first_el(x: Any)->Any: function to_int (line 88) | def to_int(b:Any)->Union[int,List[int]]: function ifnone (line 92) | def ifnone(a:Any,b:Any)->Any: function is1d (line 96) | def is1d(a:Collection)->bool: function uniqueify (line 100) | def uniqueify(x:Series, sort:bool=False)->List: function idx_dict (line 106) | def idx_dict(a): function find_classes (line 110) | def find_classes(folder:Path)->FilePathList: function arrays_split (line 117) | def arrays_split(mask:NPArrayMask, *arrs:NPArrayableList)->SplitArrayList: function random_split (line 123) | def random_split(valid_pct:float, *arrs:NPArrayableList)->SplitArrayList: function listify (line 129) | def listify(p:OptListOrItem=None, q:OptListOrItem=None): function camel2snake (line 145) | def camel2snake(name:str)->str: function even_mults (line 150) | def even_mults(start:float, stop:float, n:int)->np.ndarray: function extract_kwargs (line 156) | def extract_kwargs(names:Collection[str], kwargs:KWArgs): function partition (line 165) | def partition(a:Collection, sz:int)->List[Collection]: function partition_by_cores (line 169) | def partition_by_cores(a:Collection, n_cpus:int)->List[Collection]: function series2cat (line 173) | def series2cat(df:DataFrame, *col_names): class ItemBase (line 179) | class ItemBase(): method __init__ (line 181) | def __init__(self, data:Any): self.data=self.obj=data method __repr__ (line 182) | def __repr__(self)->str: return f'{self.__class__.__name__} {str(self)}' method show (line 183) | def show(self, ax:plt.Axes, **kwargs): method apply_tfms (line 186) | def apply_tfms(self, tfms:Collection, **kwargs): method __eq__ (line 190) | def __eq__(self, other): return recurse_eq(self.data, other.data) function recurse_eq (line 192) | def recurse_eq(arr1, arr2): function download_url (line 196) | def download_url(url:str, dest:str, overwrite:bool=False, pbar:ProgressB... function range_of (line 229) | def range_of(x): function arange_of (line 232) | def arange_of(x): function join_path (line 238) | def join_path(fname:PathOrStr, path:PathOrStr='.')->Path: function join_paths (line 242) | def join_paths(fnames:FilePathList, path:PathOrStr='.')->Collection[Path]: function loadtxt_str (line 247) | def loadtxt_str(path:PathOrStr)->np.ndarray: function save_texts (line 252) | def save_texts(fname:PathOrStr, texts:Collection[str]): function df_names_to_idx (line 257) | def df_names_to_idx(names:IntsOrStrs, df:DataFrame): function one_hot (line 263) | def one_hot(x:Collection[int], c:int): function index_row (line 269) | def index_row(a:Union[Collection,pd.DataFrame,pd.Series], idxs:Collectio... function func_args (line 278) | def func_args(func)->bool: function has_arg (line 283) | def has_arg(func, arg)->bool: function split_kwargs_by_func (line 287) | def split_kwargs_by_func(kwargs, func): function array (line 293) | def array(a, dtype:type=None, **kwargs)->np.ndarray: class EmptyLabel (line 301) | class EmptyLabel(ItemBase): method __init__ (line 303) | def __init__(self): self.obj,self.data = 0,0 method __str__ (line 304) | def __str__(self): return '' method __hash__ (line 305) | def __hash__(self): return hash(str(self)) class Category (line 307) | class Category(ItemBase): method __init__ (line 309) | def __init__(self,data,obj): self.data,self.obj = data,obj method __int__ (line 310) | def __int__(self): return int(self.data) method __str__ (line 311) | def __str__(self): return str(self.obj) method __hash__ (line 312) | def __hash__(self): return hash(str(self)) class MultiCategory (line 314) | class MultiCategory(ItemBase): method __init__ (line 316) | def __init__(self,data,obj,raw): self.data,self.obj,self.raw = data,ob... method __str__ (line 317) | def __str__(self): return ';'.join([str(o) for o in self.obj]) method __hash__ (line 318) | def __hash__(self): return hash(str(self)) class FloatItem (line 320) | class FloatItem(ItemBase): method __init__ (line 322) | def __init__(self,obj): self.data,self.obj = np.array(obj).astype(np.f... method __str__ (line 323) | def __str__(self): return str(self.obj) method __hash__ (line 324) | def __hash__(self): return hash(str(self)) function _treat_html (line 326) | def _treat_html(o:str)->str: function text2html_table (line 332) | def text2html_table(items:Collection[Collection[str]])->str: function parallel (line 346) | def parallel(func, arr:Collection, max_workers:int=None, leave=False): function subplots (line 358) | def subplots(rows:int, cols:int, imgsize:int=4, figsize:Optional[Tuple[i... function show_some (line 367) | def show_some(items:Collection, n_max:int=5, sep:str=','): function get_tmp_file (line 374) | def get_tmp_file(dir=None): function compose (line 378) | def compose(funcs:List[Callable])->Callable: class PrettyString (line 385) | class PrettyString(str): method __repr__ (line 387) | def __repr__(self): return self function float_or_x (line 389) | def float_or_x(x): function bunzip (line 394) | def bunzip(fn:PathOrStr): function working_directory (line 404) | def working_directory(path:PathOrStr): FILE: fastai/data_block.py function _decode (line 10) | def _decode(df): function _maybe_squeeze (line 13) | def _maybe_squeeze(arr): return (arr if is1d(arr) else np.squeeze(arr)) function _path_to_same_str (line 15) | def _path_to_same_str(p_fn): function _get_files (line 22) | def _get_files(parent, p, f, extensions): function get_files (line 30) | def get_files(path:PathOrStr, extensions:Collection[str]=None, recurse:b... class PreProcessor (line 48) | class PreProcessor(): method __init__ (line 50) | def __init__(self, ds:Collection=None): self.ref_ds = ds method process_one (line 51) | def process_one(self, item:Any): return item method process (line 52) | def process(self, ds:Collection): ds.items = array([self.proces... class ItemList (line 57) | class ItemList(): method __init__ (line 61) | def __init__(self, items:Iterator, path:PathOrStr='.', label_cls:Calla... method __len__ (line 71) | def __len__(self)->int: return len(self.items) or 1 method get (line 72) | def get(self, i)->Any: method __repr__ (line 75) | def __repr__(self)->str: method process (line 79) | def process(self, processor:PreProcessors=None): method process_one (line 86) | def process_one(self, item:ItemBase, processor:PreProcessors=None): method analyze_pred (line 93) | def analyze_pred(self, pred:Tensor): method reconstruct (line 97) | def reconstruct(self, t:Tensor, x:Tensor=None): method new (line 101) | def new(self, items:Iterator, processor:PreProcessors=None, **kwargs)-... method add (line 108) | def add(self, items:'ItemList'): method __getitem__ (line 115) | def __getitem__(self,idxs:int)->Any: method from_folder (line 122) | def from_folder(cls, path:PathOrStr, extensions:Collection[str]=None, ... method from_df (line 130) | def from_df(cls, df:DataFrame, path:PathOrStr='.', cols:IntsOrStrs=0, ... method from_csv (line 138) | def from_csv(cls, path:PathOrStr, csv_name:str, cols:IntsOrStrs=0, del... method _relative_item_path (line 144) | def _relative_item_path(self, i): return self.items[i].relative_to(sel... method _relative_item_paths (line 145) | def _relative_item_paths(self): return [self._relative_item_path(i) ... method use_partial_data (line 147) | def use_partial_data(self, sample_pct:float=0.01, seed:int=None)->'Ite... method to_text (line 154) | def to_text(self, fn:str): method filter_by_func (line 158) | def filter_by_func(self, func:Callable)->'ItemList': method filter_by_folder (line 163) | def filter_by_folder(self, include=None, exclude=None): method filter_by_rand (line 174) | def filter_by_rand(self, p:float, seed:int=None): method no_split (line 179) | def no_split(self): method split_none (line 183) | def split_none(self): method split_by_list (line 189) | def split_by_list(self, train, valid): method split_by_idxs (line 193) | def split_by_idxs(self, train_idx, valid_idx): method split_by_idx (line 197) | def split_by_idx(self, valid_idx:Collection[int])->'ItemLists': method _get_by_folder (line 203) | def _get_by_folder(self, name): method split_by_folder (line 207) | def split_by_folder(self, train:str='train', valid:str='valid')->'Item... method random_split_by_pct (line 211) | def random_split_by_pct(self, valid_pct:float=0.2, seed:int=None): method split_by_rand_pct (line 215) | def split_by_rand_pct(self, valid_pct:float=0.2, seed:int=None)->'Item... method split_subsets (line 223) | def split_subsets(self, train_size:float, valid_size:float, seed=None)... method split_by_valid_func (line 234) | def split_by_valid_func(self, func:Callable)->'ItemLists': method split_by_files (line 239) | def split_by_files(self, valid_names:'ItemList')->'ItemLists': method split_by_fname_file (line 244) | def split_by_fname_file(self, fname:PathOrStr, path:PathOrStr=None)->'... method split_from_df (line 250) | def split_from_df(self, col:IntsOrStrs=2): method get_label_cls (line 255) | def get_label_cls(self, labels, label_cls:Callable=None, label_delim:s... method _label_from_list (line 266) | def _label_from_list(self, labels:Iterator, label_cls:Callable=None, f... method label_from_df (line 276) | def label_from_df(self, cols:IntsOrStrs=1, label_cls:Callable=None, **... method label_const (line 285) | def label_const(self, const:Any=0, label_cls:Callable=None, **kwargs)-... method label_empty (line 289) | def label_empty(self, **kwargs): method label_from_func (line 294) | def label_from_func(self, func:Callable, label_cls:Callable=None, **kw... method label_from_folder (line 298) | def label_from_folder(self, label_cls:Callable=None, **kwargs)->'Label... method label_from_re (line 303) | def label_from_re(self, pat:str, full_path:bool=False, label_cls:Calla... method databunch (line 313) | def databunch(self, **kwargs): class EmptyLabelList (line 317) | class EmptyLabelList(ItemList): method get (line 319) | def get(self, i): return EmptyLabel() method reconstruct (line 320) | def reconstruct(self, t:Tensor, x:Tensor=None): class CategoryProcessor (line 324) | class CategoryProcessor(PreProcessor): method __init__ (line 326) | def __init__(self, ds:ItemList): method create_classes (line 330) | def create_classes(self, classes): method generate_classes (line 334) | def generate_classes(self, items): method process_one (line 338) | def process_one(self,item): method process (line 344) | def process(self, ds): method __getstate__ (line 350) | def __getstate__(self): return {n:getattr(self,n) for n in self.state_... method __setstate__ (line 351) | def __setstate__(self, state:dict): class CategoryListBase (line 357) | class CategoryListBase(ItemList): method __init__ (line 359) | def __init__(self, items:Iterator, classes:Collection=None, **kwargs): method c (line 366) | def c(self): return len(self.classes) class CategoryList (line 368) | class CategoryList(CategoryListBase): method __init__ (line 371) | def __init__(self, items:Iterator, classes:Collection=None, label_deli... method get (line 375) | def get(self, i): method analyze_pred (line 380) | def analyze_pred(self, pred, thresh:float=0.5): return pred.argmax() method reconstruct (line 382) | def reconstruct(self, t): class MultiCategoryProcessor (line 385) | class MultiCategoryProcessor(CategoryProcessor): method __init__ (line 387) | def __init__(self, ds:ItemList, one_hot:bool=False): method process_one (line 392) | def process_one(self,item): method generate_classes (line 397) | def generate_classes(self, items): class MultiCategoryList (line 405) | class MultiCategoryList(CategoryListBase): method __init__ (line 408) | def __init__(self, items:Iterator, classes:Collection=None, label_deli... method get (line 418) | def get(self, i): method analyze_pred (line 424) | def analyze_pred(self, pred, thresh:float=0.5): method reconstruct (line 427) | def reconstruct(self, t): class FloatList (line 431) | class FloatList(ItemList): method __init__ (line 433) | def __init__(self, items:Iterator, log:bool=False, classes:Collection=... method get (line 440) | def get(self, i): method reconstruct (line 444) | def reconstruct(self,t): return FloatItem(t.numpy()) class ItemLists (line 446) | class ItemLists(): method __init__ (line 448) | def __init__(self, path:PathOrStr, train:ItemList, valid:ItemList): method __dir__ (line 457) | def __dir__(self)->List[str]: method __repr__ (line 463) | def __repr__(self)->str: method __getattr__ (line 466) | def __getattr__(self, k): method __setstate__ (line 481) | def __setstate__(self,data:Any): self.__dict__.update(data) method lists (line 484) | def lists(self): method label_from_lists (line 489) | def label_from_lists(self, train_labels:Iterator, valid_labels:Iterato... method transform (line 498) | def transform(self, tfms:Optional[Tuple[TfmList,TfmList]]=(None,None),... method transform_y (line 507) | def transform_y(self, tfms:Optional[Tuple[TfmList,TfmList]]=(None,None... method databunch (line 515) | def databunch(self, **kwargs): class LabelLists (line 519) | class LabelLists(ItemLists): method get_processors (line 521) | def get_processors(self): method process (line 528) | def process(self): method filter_by_func (line 537) | def filter_by_func(self, func:Callable): method databunch (line 541) | def databunch(self, path:PathOrStr=None, bs:int=64, val_bs:int=None, n... method add_test (line 554) | def add_test(self, items:Iterator, label:Any=None, tfms=None, tfm_y=No... method add_test_folder (line 565) | def add_test_folder(self, test_folder:str='test', label:Any=None, tfms... method load_state (line 572) | def load_state(cls, path:PathOrStr, state:dict): method load_empty (line 580) | def load_empty(cls, path:PathOrStr, fn:PathOrStr='export.pkl'): function _check_kwargs (line 586) | def _check_kwargs(ds:ItemList, tfms:TfmList, **kwargs): class LabelList (line 595) | class LabelList(Dataset): method __init__ (line 597) | def __init__(self, x:ItemList, y:ItemList, tfms:TfmList=None, tfm_y:bo... method __len__ (line 603) | def __len__(self)->int: return len(self.x) if self.item is None else 1 method set_item (line 606) | def set_item(self,item): method __repr__ (line 612) | def __repr__(self)->str: method predict (line 619) | def predict(self, res): method c (line 624) | def c(self): return self.y.c method new (line 626) | def new(self, x, y, tfms=None, tfm_y=None, **kwargs)->'LabelList': method __getattr__ (line 633) | def __getattr__(self,k:str)->Any: method __setstate__ (line 642) | def __setstate__(self,data:Any): self.__dict__.update(data) method __getitem__ (line 644) | def __getitem__(self,idxs:Union[int,np.ndarray])->'LabelList': method to_df (line 658) | def to_df(self)->None: method to_csv (line 662) | def to_csv(self, dest:str)->None: method get_state (line 666) | def get_state(self, **kwargs): method export (line 675) | def export(self, fn:PathOrStr, **kwargs): method load_empty (line 680) | def load_empty(cls, path:PathOrStr, fn:PathOrStr): method load_state (line 685) | def load_state(cls, path:PathOrStr, state:dict) -> 'LabelList': method process (line 695) | def process(self, xp:PreProcessor=None, yp:PreProcessor=None, name:str... method filter_by_func (line 714) | def filter_by_func(self, func:Callable): method transform (line 719) | def transform(self, tfms:TfmList, tfm_y:bool=None, **kwargs): method transform_y (line 729) | def transform_y(self, tfms:TfmList=None, **kwargs): method databunch (line 737) | def databunch(self, **kwargs): function _databunch_load_empty (line 742) | def _databunch_load_empty(cls, path, fname:str='export.pkl'): class MixedProcessor (line 749) | class MixedProcessor(PreProcessor): method __init__ (line 750) | def __init__(self, procs:Collection[Union[PreProcessor, Collection[Pre... method process_one (line 753) | def process_one(self, item:Any): method process (line 760) | def process(self, ds:Collection): class MixedItem (line 764) | class MixedItem(ItemBase): method __init__ (line 765) | def __init__(self, items): method __repr__ (line 769) | def __repr__(self): return '\n'.join([f'{self.__class__.__name__}'] + ... method apply_tfms (line 771) | def apply_tfms(self, tfms:Collection, **kwargs): class MixedItemList (line 776) | class MixedItemList(ItemList): method __init__ (line 778) | def __init__(self, item_lists, path:PathOrStr=None, label_cls:Callable... method new (line 789) | def new(self, item_lists, processor:PreProcessor=None, **kwargs)->'Ite... method get (line 796) | def get(self, i): method __getitem__ (line 799) | def __getitem__(self,idxs:int)->Any: FILE: fastai/datasets.py class URLs (line 8) | class URLs(): class Config (line 129) | class Config(): method get_key (line 140) | def get_key(cls, key): method get_path (line 145) | def get_path(cls, path): method data_path (line 150) | def data_path(cls): method data_archive_path (line 155) | def data_archive_path(cls): method model_path (line 160) | def model_path(cls): method get (line 165) | def get(cls, fpath=None, create_missing=True): method create (line 173) | def create(cls, fpath): function _expand_path (line 182) | def _expand_path(fpath): return Path(fpath).expanduser() function url2name (line 183) | def url2name(url): return url.split('/')[-1] function url2path (line 186) | def url2path(url, data=True, ext:str='.tgz'): function _url2tgz (line 190) | def _url2tgz(url, data=True, ext:str='.tgz'): function modelpath4file (line 193) | def modelpath4file(filename, ext:str='.tgz'): function datapath4file (line 199) | def datapath4file(filename, ext:str='.tgz', archive=True): function download_data (line 206) | def download_data(url:str, fname:PathOrStr=None, data:bool=True, ext:str... function _check_file (line 215) | def _check_file(fname): function untar_data (line 221) | def untar_data(url:str, fname:PathOrStr=None, dest:PathOrStr=None, data=... FILE: fastai/distributed.py function rnn_reset (line 10) | def rnn_reset(self): class ParallelTrainer (line 14) | class ParallelTrainer(LearnerCallback): method on_train_begin (line 16) | def on_train_begin(self, **kwargs): self.learn.model = DataParallel(se... method on_train_end (line 17) | def on_train_end (self, **kwargs): self.learn.model = self.learn.mode... class DistributedTrainer (line 19) | class DistributedTrainer(LearnerCallback): method __init__ (line 21) | def __init__(self, learn:Learner, cuda_id:int=0): method _change_dl (line 25) | def _change_dl(self, dl, shuffle): method on_train_begin (line 31) | def on_train_begin(self, **kwargs): method on_epoch_begin (line 40) | def on_epoch_begin(self, epoch, **kwargs): self.train_sampler.set_epoc... method on_train_end (line 42) | def on_train_end(self, **kwargs): class DistributedRecorder (line 48) | class DistributedRecorder(LearnerCallback): method __init__ (line 49) | def __init__(self, learn:Learner, cuda_id:int=0, cache_dir:PathOrStr='... method on_train_begin (line 53) | def on_train_begin(self, **kwargs): method on_epoch_end (line 56) | def on_epoch_end(self, **kwargs): self.save_stats() method on_train_end (line 57) | def on_train_end(self, **kwargs): self.save_stats() method save_stats (line 59) | def save_stats(self): function _learner_parallel (line 65) | def _learner_parallel(learn:Learner): function _learner_distributed (line 71) | def _learner_distributed(learn:Learner, cuda_id:int, cache_dir:PathOrStr... function read_metrics (line 80) | def read_metrics(cache_path:PathOrStr, n_gpus:int, reduce:bool=True): function setup_distrib (line 90) | def setup_distrib(gpu:Any=None): class OurDistributedSampler (line 98) | class OurDistributedSampler(DistributedSampler): method __init__ (line 100) | def __init__(self, dataset, num_replicas=None, rank=None, shuffle=True): method __iter__ (line 104) | def __iter__(self): FILE: fastai/gen_doc/convert2html.py function read_nb (line 17) | def read_nb(fname): function convert_nb (line 21) | def convert_nb(fname, dest_path='.'): function convert_all (line 35) | def convert_all(folder, dest_path='.', force_all=False): FILE: fastai/gen_doc/core.py function strip_fastai (line 4) | def strip_fastai(s): return re.sub(r'^fastai\.', '', s) FILE: fastai/gen_doc/docstrings.py function trim (line 29) | def trim(docstring): function reindent (line 63) | def reindent(string): function parse_docstring (line 67) | def parse_docstring(docstring): class InfoMixin (line 118) | class InfoMixin(object): method _get_doc (line 121) | def _get_doc(cls): method get_info (line 130) | def get_info(cls): FILE: fastai/gen_doc/doctest.py function _json_set_default (line 10) | def _json_set_default(obj): class TestRegistry (line 14) | class TestRegistry: method this_tests (line 28) | def this_tests(*funcs): method this_tests_check_on (line 49) | def this_tests_check_on(): method this_tests_check_off (line 52) | def this_tests_check_off(): method this_tests_check_run (line 55) | def this_tests_check_run(file_name, test_name): method registry_save (line 59) | def registry_save(): method missing_this_tests_alert (line 70) | def missing_this_tests_alert(): function a2k (line 81) | def a2k(a): return '::'.join([a['file'], a['test']]), a['line'] function k2a (line 82) | def k2a(k, v): f,t = k.split('::'); return {"file": f, "line": v, "test"... function merge_lists (line 84) | def merge_lists(a, b): function merge_registries (line 87) | def merge_registries(a, b): function this_tests (line 91) | def this_tests(*funcs): TestRegistry.this_tests(*funcs) function str2func (line 93) | def str2func(name): function get_func_fq_name (line 107) | def get_func_fq_name(func): function get_parent_func (line 118) | def get_parent_func(lineno, lines, ignore_missing=False): function relative_test_path (line 126) | def relative_test_path(test_file:Path)->str: function get_lines (line 132) | def get_lines(file): FILE: fastai/gen_doc/gen_notebooks.py function get_empty_notebook (line 13) | def get_empty_notebook(): function get_md_cell (line 29) | def get_md_cell(source, metadata=None): function get_empty_cell (line 35) | def get_empty_cell(ctype='markdown'): function get_code_cell (line 39) | def get_code_cell(code, hidden=False): function get_doc_cell (line 47) | def get_doc_cell(func_name): function get_global_vars (line 52) | def get_global_vars(mod): function write_nb (line 68) | def write_nb(nb, nb_path, mode='w'): class ExecuteShowDocPreprocessor (line 71) | class ExecuteShowDocPreprocessor(ExecutePreprocessor): method preprocess_cell (line 73) | def preprocess_cell(self, cell, resources, index): function execute_nb (line 79) | def execute_nb(fname, metadata=None, save=True, show_doc_only=False): function _symbol_skeleton (line 91) | def _symbol_skeleton(name): return [get_doc_cell(name), get_md_cell(f"`{... function create_module_page (line 93) | def create_module_page(mod, dest_path, force=False): function get_module_names (line 121) | def get_module_names(path_dir, exclude=None): function read_nb (line 134) | def read_nb(fname): function read_nb_content (line 139) | def read_nb_content(cells, mod_name): function read_nb_types (line 148) | def read_nb_types(cells): function link_markdown_cells (line 156) | def link_markdown_cells(cells, modules): function get_insert_idx (line 162) | def get_insert_idx(pos_dict, name): function update_pos (line 169) | def update_pos(pos_dict, start_key, nbr=2): function insert_cells (line 175) | def insert_cells(cells, pos_dict, ft_name, append=False): function get_doc_path (line 185) | def get_doc_path(mod, dest_path): function generate_missing_metadata (line 189) | def generate_missing_metadata(dest_file): function update_nb_metadata (line 204) | def update_nb_metadata(nb_path=None, title=None, summary=None, keywords=... function has_metadata_cell (line 214) | def has_metadata_cell(cells, fn): function stringify (line 218) | def stringify(s): return f'\'{s}\'' if isinstance(s, str) else s function get_imported_modules (line 221) | def get_imported_modules(cells, nb_module_name=''): function get_top_level_modules (line 231) | def get_top_level_modules(num_levels=1): function parse_sections (line 238) | def parse_sections(cells): function remove_undoc_cells (line 250) | def remove_undoc_cells(cells): function remove_code_cell_jupyter_widget_state_elem (line 255) | def remove_code_cell_jupyter_widget_state_elem(cells): function update_module_page (line 262) | def update_module_page(mod, dest_path='.'): function link_nb (line 290) | def link_nb(nb_path): function get_module_from_notebook (line 297) | def get_module_from_notebook(doc_path): function check_nbconvert_version (line 301) | def check_nbconvert_version(): function update_notebooks (line 305) | def update_notebooks(source_path, dest_path=None, update_html=True, docu... FILE: fastai/gen_doc/nbdoc.py function is_enum (line 29) | def is_enum(cls): return cls == enum.Enum or cls == enum.EnumMeta function link_type (line 31) | def link_type(arg_type, arg_name=None, include_bt:bool=True): function is_fastai_class (line 39) | def is_fastai_class(t): return belongs_to_module(t, MODULE_NAME) function belongs_to_module (line 41) | def belongs_to_module(t, module_name): function code_esc (line 47) | def code_esc(s): return f'`{s}`' function type_repr (line 49) | def type_repr(t): function partial_repr (line 61) | def partial_repr(t): function anno_repr (line 66) | def anno_repr(a): return type_repr(a) function format_param (line 68) | def format_param(p): function format_ft_def (line 79) | def format_ft_def(func, full_name:str=None)->str: function get_enum_doc (line 91) | def get_enum_doc(elt, full_name:str)->str: function get_cls_doc (line 96) | def get_cls_doc(elt, full_name:str)->str: function show_doc (line 103) | def show_doc(elt, doc_string:bool=True, full_name:str=None, arg_comments... function md2html (line 126) | def md2html(md): function doc (line 130) | def doc(elt): function format_docstring (line 145) | def format_docstring(elt, arg_comments:dict={}, alt_doc_string:str='', i... function replace_link (line 165) | def replace_link(m): function link_docstring (line 173) | def link_docstring(modules, docstring:str, overwrite:bool=False)->str: function find_elt (line 179) | def find_elt(modvars, keyword, match_last=False): function import_mod (line 187) | def import_mod(mod_name:str, ignore_errors=False): function show_doc_from_name (line 197) | def show_doc_from_name(mod_name, ft_name:str, doc_string:bool=True, arg_... function get_exports (line 208) | def get_exports(mod): function get_ft_names (line 213) | def get_ft_names(mod, include_inner=False)->List[str]: function get_inner_fts (line 234) | def get_inner_fts(elt)->List[str]: function get_module_toc (line 245) | def get_module_toc(mod_name): function show_video (line 260) | def show_video(url): function show_video_from_youtube (line 265) | def show_video_from_youtube(code, start=0): function get_anchor (line 270) | def get_anchor(fn)->str: function fn_name (line 275) | def fn_name(ft)->str: function get_fn_link (line 282) | def get_fn_link(ft)->str: function get_module_name (line 290) | def get_module_name(ft)->str: return inspect.getmodule(ft).__name__ function get_pytorch_link (line 292) | def get_pytorch_link(ft)->str: function get_source_link (line 314) | def get_source_link(file, line, display_text="[source]", **kwargs)->str: function get_function_source (line 320) | def get_function_source(ft, **kwargs)->str: function title_md (line 327) | def title_md(s:str, title_level:int, markdown=True): function jekyll_div (line 332) | def jekyll_div(s,c,h,icon=None): function jekyll_note (line 337) | def jekyll_note(s): return jekyll_div(s,'info','Note') function jekyll_warn (line 338) | def jekyll_warn(s): return jekyll_div(s,'danger','Warning', 'exclamation') function jekyll_important (line 339) | def jekyll_important(s): return jekyll_div(s,'warning','Important') FILE: fastai/gen_doc/nbtest.py function show_test (line 20) | def show_test(elt)->str: function doctest (line 25) | def doctest(elt): function build_tests_markdown (line 32) | def build_tests_markdown(elt): function tests2md (line 50) | def tests2md(tests, type_label:str): function get_pytest_html (line 55) | def get_pytest_html(elt, anchor_id:str)->Tuple[str,str]: function get_pytest_card (line 62) | def get_pytest_card(html, anchor_id): function lookup_db (line 71) | def lookup_db(elt)->List[Dict]: function find_related_tests (line 81) | def find_related_tests(elt)->Tuple[List[Dict],List[Dict]]: function get_tests_dir (line 89) | def get_tests_dir(elt)->Path: function get_file (line 95) | def get_file(elt)->str: function find_test_files (line 100) | def find_test_files(elt, exact_match:bool=False)->List[Path]: function _is_file_match (line 107) | def _is_file_match(elt, file_name:str, exact_match:bool=False)->bool: function _submodule_name (line 114) | def _submodule_name(elt)->str: function find_test_matches (line 122) | def find_test_matches(elt, test_file:Path)->Tuple[List[Dict],List[Dict]]: function get_qualname (line 129) | def get_qualname(elt): function separate_comp (line 132) | def separate_comp(qualname:str): function remove_underscore (line 139) | def remove_underscore(fn_name): function fuzzy_test_match (line 143) | def fuzzy_test_match(fn_name:str, lines:List[Dict], rel_path:str)->List[... function _fuzzy_line_match (line 150) | def _fuzzy_line_match(fn_name:str, lines)->List[TestFunctionMatch]: function get_lines (line 159) | def get_lines(file:Path)->List[str]: function map_test (line 162) | def map_test(test_file, line, line_text): function get_links (line 167) | def get_links(metadata)->Tuple[str,str]: function pytest_command (line 171) | def pytest_command(file:str, test:str, **kwargs)->str: FILE: fastai/general_optimizer.py class Statistic (line 10) | class Statistic(): method buf (line 17) | def buf(self): return f'{self.name}_buffer' method new_step (line 19) | def new_step(self): method accumulate (line 23) | def accumulate(self, val): method update (line 27) | def update(self, state, param, val=None, step=None): class ConstStatistic (line 31) | class ConstStatistic(Statistic): method buf (line 33) | def buf(self): return None method new_step (line 34) | def new_step(self): pass method accumulate (line 35) | def accumulate(self): pass method update (line 36) | def update(self, state, param, val=None, step=None): return param class CounterStat (line 39) | class CounterStat(Statistic): method __post_init__ (line 40) | def __post_init__(self): self.init,self._buf,self.name = 0,self.name,None method buf (line 42) | def buf(self): return self._buf method new_step (line 43) | def new_step(self): pass method accumulate (line 44) | def accumulate(self, val): pass method update (line 45) | def update(self, state, param, val=None, step=None): return state + 1 class AvgStatistic (line 48) | class AvgStatistic(Statistic): method new_step (line 51) | def new_step(self): self.val,self.count = 0.,0 method accumulate (line 53) | def accumulate(self, val): method _get_val1 (line 57) | def _get_val1(self, val): return val.mean() method _get_val2 (line 58) | def _get_val2(self, state, val, param): return state.add_(1-param, val... method _get_val3 (line 59) | def _get_val3(self, state, val, param): method update (line 63) | def update(self, state, param, val=None, step=None): class AvgSquare (line 77) | class AvgSquare(AvgStatistic): method __init__ (line 79) | def __init__(self, name:str, param:float=0.9, scope=StatScope.Weight, ... method _get_val1 (line 82) | def _get_val1(self, val): return torch.norm(val).pow(2)/val.numel() method _get_val2 (line 83) | def _get_val2(self, state, val, param): method _get_val3 (line 85) | def _get_val3(self, state, val, param): class GeneralOptimizer (line 89) | class GeneralOptimizer(Optimizer): method __init__ (line 90) | def __init__(self, params, stats=None, on_step:Callable=None): method step (line 97) | def step(self, closure=None): method on_step (line 103) | def on_step(self, p, group, group_idx): p.data.add_(-group['lr'], p.gr... method _split_stats (line 105) | def _split_stats(self, stats): method _init_stats (line 111) | def _init_stats(self, stats, data=None): method init_stats (line 115) | def init_stats(self): method _set_bufs (line 124) | def _set_bufs(self, p, stats, pg, val=None): method update_stats (line 129) | def update_stats(self): FILE: fastai/imports/core.py function try_import (line 39) | def try_import(module): function have_min_pkg_version (line 44) | def have_min_pkg_version(package, version): FILE: fastai/launch.py function main (line 5) | def main( FILE: fastai/layers.py class Lambda (line 10) | class Lambda(Module): method __init__ (line 12) | def __init__(self, func:LambdaFunc): self.func=func method forward (line 13) | def forward(self, x): return self.func(x) class View (line 15) | class View(Module): method __init__ (line 17) | def __init__(self, *size:int): self.size = size method forward (line 18) | def forward(self, x): return x.view(self.size) class ResizeBatch (line 20) | class ResizeBatch(Module): method __init__ (line 22) | def __init__(self, *size:int): self.size = size method forward (line 23) | def forward(self, x): return x.view((x.size(0),) + self.size) class Flatten (line 25) | class Flatten(Module): method __init__ (line 27) | def __init__(self, full:bool=False): self.full = full method forward (line 28) | def forward(self, x): return x.view(-1) if self.full else x.view(x.siz... function PoolFlatten (line 30) | def PoolFlatten()->nn.Sequential: function batchnorm_2d (line 36) | def batchnorm_2d(nf:int, norm_type:NormType=NormType.Batch): function bn_drop_lin (line 44) | def bn_drop_lin(n_in:int, n_out:int, bn:bool=True, p:float=0., actn:Opti... function conv1d (line 52) | def conv1d(ni:int, no:int, ks:int=1, stride:int=1, padding:int=0, bias:b... class PooledSelfAttention2d (line 59) | class PooledSelfAttention2d(Module): method __init__ (line 61) | def __init__(self, n_channels:int): method forward (line 69) | def forward(self, x): class SelfAttention (line 81) | class SelfAttention(Module): method __init__ (line 83) | def __init__(self, n_channels:int): method forward (line 89) | def forward(self, x): function conv2d (line 98) | def conv2d(ni:int, nf:int, ks:int=3, stride:int=1, padding:int=None, bia... function conv2d_trans (line 103) | def conv2d_trans(ni:int, nf:int, ks:int=2, stride:int=2, padding:int=0, ... function relu (line 107) | def relu(inplace:bool=False, leaky:float=None): function conv_layer (line 111) | def conv_layer(ni:int, nf:int, ks:int=3, stride:int=1, padding:int=None,... class SequentialEx (line 128) | class SequentialEx(Module): method __init__ (line 130) | def __init__(self, *layers): self.layers = nn.ModuleList(layers) method forward (line 132) | def forward(self, x): method __getitem__ (line 144) | def __getitem__(self,i): return self.layers[i] method append (line 145) | def append(self,l): return self.layers.append(l) method extend (line 146) | def extend(self,l): return self.layers.extend(l) method insert (line 147) | def insert(self,i,l): return self.layers.insert(i,l) class MergeLayer (line 149) | class MergeLayer(Module): method __init__ (line 151) | def __init__(self, dense:bool=False): self.dense=dense method forward (line 152) | def forward(self, x): return torch.cat([x,x.orig], dim=1) if self.dens... function res_block (line 154) | def res_block(nf, dense:bool=False, norm_type:Optional[NormType]=NormTyp... function sigmoid_range (line 163) | def sigmoid_range(x:Tensor, low:int, high:int): class SigmoidRange (line 167) | class SigmoidRange(Module): method __init__ (line 169) | def __init__(self, low:int, high:int): self.low,self.high = low,high method forward (line 170) | def forward(self, x): return sigmoid_range(x, self.low, self.high) class PartialLayer (line 172) | class PartialLayer(Module): method __init__ (line 174) | def __init__(self, func, **kwargs): self.repr,self.func = f'{func}({kw... method forward (line 175) | def forward(self, x): return self.func(x) method __repr__ (line 176) | def __repr__(self): return self.repr class AdaptiveConcatPool2d (line 178) | class AdaptiveConcatPool2d(Module): method __init__ (line 180) | def __init__(self, sz:Optional[int]=None): method forward (line 186) | def forward(self, x): return torch.cat([self.mp(x), self.ap(x)], 1) class Debugger (line 188) | class Debugger(Module): method forward (line 190) | def forward(self,x:Tensor) -> Tensor: function icnr (line 194) | def icnr(x, scale=2, init=nn.init.kaiming_normal_): class PixelShuffle_ICNR (line 204) | class PixelShuffle_ICNR(Module): method __init__ (line 206) | def __init__(self, ni:int, nf:int=None, scale:int=2, blur:bool=False, ... method forward (line 218) | def forward(self,x): class FlattenedLoss (line 222) | class FlattenedLoss(): method __init__ (line 224) | def __init__(self, func, *args, axis:int=-1, floatify:bool=False, is_2... method __repr__ (line 228) | def __repr__(self): return f"FlattenedLoss of {self.func}" method reduction (line 230) | def reduction(self): return self.func.reduction method reduction (line 232) | def reduction(self, v): self.func.reduction = v method __call__ (line 234) | def __call__(self, input:Tensor, target:Tensor, **kwargs)->Rank0Tensor: function CrossEntropyFlat (line 241) | def CrossEntropyFlat(*args, axis:int=-1, **kwargs): function BCEWithLogitsFlat (line 245) | def BCEWithLogitsFlat(*args, axis:int=-1, floatify:bool=True, **kwargs): function BCEFlat (line 249) | def BCEFlat(*args, axis:int=-1, floatify:bool=True, **kwargs): function MSELossFlat (line 253) | def MSELossFlat(*args, axis:int=-1, floatify:bool=True, **kwargs): class NoopLoss (line 257) | class NoopLoss(Module): method forward (line 259) | def forward(self, output, *args): return output.mean() class WassersteinLoss (line 261) | class WassersteinLoss(Module): method forward (line 263) | def forward(self, real, fake): return real.mean() - fake.mean() function simple_cnn (line 265) | def simple_cnn(actns:Collection[int], kernel_szs:Collection[int]=None, function trunc_normal_ (line 276) | def trunc_normal_(x:Tensor, mean:float=0., std:float=1.) -> Tensor: function embedding (line 281) | def embedding(ni:int,nf:int) -> nn.Module: class BatchNorm1dFlat (line 288) | class BatchNorm1dFlat(nn.BatchNorm1d): method forward (line 290) | def forward(self, x): class LabelSmoothingCrossEntropy (line 296) | class LabelSmoothingCrossEntropy(Module): method __init__ (line 297) | def __init__(self, eps:float=0.1, reduction='mean'): self.eps,self.red... method forward (line 299) | def forward(self, output, target): FILE: fastai/metrics.py function fbeta (line 13) | def fbeta(y_pred:Tensor, y_true:Tensor, thresh:float=0.2, beta:float=2, ... function accuracy (line 25) | def accuracy(input:Tensor, targs:Tensor)->Rank0Tensor: function accuracy_thresh (line 32) | def accuracy_thresh(y_pred:Tensor, y_true:Tensor, thresh:float=0.5, sigm... function top_k_accuracy (line 37) | def top_k_accuracy(input:Tensor, targs:Tensor, k:int=5)->Rank0Tensor: function foreground_acc (line 43) | def foreground_acc(input, target, void_code): function error_rate (line 49) | def error_rate(input:Tensor, targs:Tensor)->Rank0Tensor: function dice (line 53) | def dice(input:Tensor, targs:Tensor, iou:bool=False, eps:float=1e-8)->Ra... function psnr (line 63) | def psnr(input:Tensor, targs:Tensor)->Rank0Tensor: function exp_rmspe (line 66) | def exp_rmspe(pred:Tensor, targ:Tensor)->Rank0Tensor: function mean_absolute_error (line 73) | def mean_absolute_error(pred:Tensor, targ:Tensor)->Rank0Tensor: function mean_squared_error (line 78) | def mean_squared_error(pred:Tensor, targ:Tensor)->Rank0Tensor: function root_mean_squared_error (line 83) | def root_mean_squared_error(pred:Tensor, targ:Tensor)->Rank0Tensor: function mean_squared_logarithmic_error (line 88) | def mean_squared_logarithmic_error(pred:Tensor, targ:Tensor)->Rank0Tensor: function explained_variance (line 93) | def explained_variance(pred:Tensor, targ:Tensor)->Rank0Tensor: function r2_score (line 99) | def r2_score(pred:Tensor, targ:Tensor)->Rank0Tensor: class RegMetrics (line 106) | class RegMetrics(Callback): method on_epoch_begin (line 108) | def on_epoch_begin(self, **kwargs): method on_batch_end (line 111) | def on_batch_end(self, last_output:Tensor, last_target:Tensor, **kwargs): class R2Score (line 116) | class R2Score(RegMetrics): method on_epoch_end (line 118) | def on_epoch_end(self, last_metrics, **kwargs): class ExplainedVariance (line 121) | class ExplainedVariance(RegMetrics): method on_epoch_end (line 123) | def on_epoch_end(self, last_metrics, **kwargs): class RMSE (line 126) | class RMSE(RegMetrics): method on_epoch_end (line 128) | def on_epoch_end(self, last_metrics, **kwargs): class ExpRMSPE (line 131) | class ExpRMSPE(RegMetrics): method on_epoch_end (line 133) | def on_epoch_end(self, last_metrics, **kwargs): class ConfusionMatrix (line 142) | class ConfusionMatrix(Callback): method on_train_begin (line 145) | def on_train_begin(self, **kwargs): method on_epoch_begin (line 148) | def on_epoch_begin(self, **kwargs): method on_batch_end (line 151) | def on_batch_end(self, last_output:Tensor, last_target:Tensor, **kwargs): method on_epoch_end (line 161) | def on_epoch_end(self, **kwargs): class CMScores (line 165) | class CMScores(ConfusionMatrix): method _recall (line 171) | def _recall(self): method _precision (line 179) | def _precision(self): method _weights (line 186) | def _weights(self, avg:str): class Recall (line 201) | class Recall(CMScores): method on_epoch_end (line 203) | def on_epoch_end(self, last_metrics, **kwargs): class Precision (line 206) | class Precision(CMScores): method on_epoch_end (line 208) | def on_epoch_end(self, last_metrics, **kwargs): class FBeta (line 212) | class FBeta(CMScores): method on_train_begin (line 216) | def on_train_begin(self, **kwargs): method on_epoch_end (line 222) | def on_epoch_end(self, last_metrics, **kwargs): method on_train_end (line 230) | def on_train_end(self, **kwargs): self.average = self.avg class KappaScore (line 233) | class KappaScore(ConfusionMatrix): method on_epoch_end (line 237) | def on_epoch_end(self, last_metrics, **kwargs): class MatthewsCorreff (line 253) | class MatthewsCorreff(ConfusionMatrix): method on_epoch_end (line 255) | def on_epoch_end(self, last_metrics, **kwargs): class Perplexity (line 265) | class Perplexity(Callback): method on_epoch_begin (line 267) | def on_epoch_begin(self, **kwargs): self.loss,self.len = 0.,0 method on_batch_end (line 269) | def on_batch_end(self, last_output, last_target, **kwargs): method on_epoch_end (line 273) | def on_epoch_end(self, last_metrics, **kwargs): function auc_roc_score (line 276) | def auc_roc_score(input:Tensor, targ:Tensor): function roc_curve (line 284) | def roc_curve(input:Tensor, targ:Tensor): class AUROC (line 302) | class AUROC(Callback): method on_epoch_begin (line 304) | def on_epoch_begin(self, **kwargs): method on_batch_end (line 307) | def on_batch_end(self, last_output:Tensor, last_target:Tensor, **kwargs): method on_epoch_end (line 312) | def on_epoch_end(self, last_metrics, **kwargs): class MultiLabelFbeta (line 315) | class MultiLabelFbeta(LearnerCallback): method __init__ (line 319) | def __init__(self, learn, beta=2, eps=1e-15, thresh=0.3, sigmoid=True,... method on_train_begin (line 324) | def on_train_begin(self, **kwargs): method on_epoch_begin (line 329) | def on_epoch_begin(self, **kwargs): method on_batch_end (line 335) | def on_batch_end(self, last_output, last_target, **kwargs): method fbeta_score (line 342) | def fbeta_score(self, precision, recall): method on_epoch_end (line 345) | def on_epoch_end(self, last_metrics, **kwargs): FILE: fastai/script.py class Param (line 8) | class Param(): method pre (line 20) | def pre(self): return '--' if self.opt else '' method kwargs (line 22) | def kwargs(self): return {k:v for k,v in self.__dict__.items() function anno_parser (line 25) | def anno_parser(func): function call_parse (line 35) | def call_parse(func): function call_plac (line 43) | def call_plac(f): FILE: fastai/sixel.py function _sixel_encode (line 5) | def _sixel_encode(data, width, height): function plot_sixel (line 14) | def plot_sixel(fig=None): FILE: fastai/tabular/data.py function emb_sz_rule (line 15) | def emb_sz_rule(n_cat:int)->int: return min(600, round(1.6 * n_cat**0.56)) function def_emb_sz (line 17) | def def_emb_sz(classes, n, sz_dict=None): class TabularLine (line 24) | class TabularLine(ItemBase): method __init__ (line 26) | def __init__(self, cats, conts, classes, names): method __str__ (line 30) | def __str__(self): class TabularProcessor (line 38) | class TabularProcessor(PreProcessor): method __init__ (line 40) | def __init__(self, ds:ItemBase=None, procs=None): method process_one (line 44) | def process_one(self, item): method process (line 57) | def process(self, ds): class TabularDataBunch (line 85) | class TabularDataBunch(DataBunch): method from_df (line 88) | def from_df(cls, path, df:DataFrame, dep_var:str, valid_idx:Collection... class TabularList (line 104) | class TabularList(ItemList): method __init__ (line 109) | def __init__(self, items:Iterator, cat_names:OptStrList=None, cont_nam... method from_df (line 120) | def from_df(cls, df:DataFrame, cat_names:OptStrList=None, cont_names:O... method get (line 124) | def get(self, o): method get_emb_szs (line 130) | def get_emb_szs(self, sz_dict=None): method reconstruct (line 134) | def reconstruct(self, t:Tensor): method show_xys (line 137) | def show_xys(self, xs, ys)->None: method show_xyzs (line 154) | def show_xyzs(self, xs, ys, zs): function tabular_learner (line 171) | def tabular_learner(data:DataBunch, layers:Collection[int], emb_szs:Dict... FILE: fastai/tabular/models.py class TabularModel (line 9) | class TabularModel(Module): method __init__ (line 11) | def __init__(self, emb_szs:ListSizes, n_cont:int, out_sz:int, layers:C... method get_sizes (line 29) | def get_sizes(self, layers, out_sz): method forward (line 32) | def forward(self, x_cat:Tensor, x_cont:Tensor) -> Tensor: function _cl_int_from_learner (line 46) | def _cl_int_from_learner(cls, learn:Learner, ds_type=DatasetType.Valid, ... function _cl_int_plot_top_losses (line 51) | def _cl_int_plot_top_losses(self, k, largest:bool=True, return_table:boo... function _learner_interpret (line 78) | def _learner_interpret(learn:Learner, ds_type:DatasetType = DatasetType.... FILE: fastai/tabular/transform.py function make_date (line 10) | def make_date(df:DataFrame, date_field:str): function cyclic_dt_feat_names (line 18) | def cyclic_dt_feat_names(time:bool=True, add_linear:bool=False)->List[str]: function cyclic_dt_features (line 26) | def cyclic_dt_features(d:Union[date,datetime], time:bool=True, add_linea... function add_cyclic_datepart (line 43) | def add_cyclic_datepart(df:DataFrame, field_name:str, prefix:str=None, d... function add_datepart (line 55) | def add_datepart(df:DataFrame, field_name:str, prefix:str=None, drop:boo... function _get_elapsed (line 68) | def _get_elapsed(df:DataFrame,field_names:Collection[str], date_field:st... function add_elapsed_times (line 80) | def add_elapsed_times(df:DataFrame, field_names:Collection[str], date_fi... function cont_cat_split (line 106) | def cont_cat_split(df, max_card=20, dep_var=None)->Tuple[List,List]: class TabularProc (line 116) | class TabularProc(): method __call__ (line 121) | def __call__(self, df:DataFrame, test:bool=False): method apply_train (line 126) | def apply_train(self, df:DataFrame): method apply_test (line 129) | def apply_test(self, df:DataFrame): class Categorify (line 133) | class Categorify(TabularProc): method apply_train (line 135) | def apply_train(self, df:DataFrame): method apply_test (line 142) | def apply_test(self, df:DataFrame): class FillMissing (line 150) | class FillMissing(TabularProc): method apply_train (line 155) | def apply_train(self, df:DataFrame): method apply_test (line 169) | def apply_test(self, df:DataFrame): class Normalize (line 181) | class Normalize(TabularProc): method apply_train (line 183) | def apply_train(self, df:DataFrame): method apply_test (line 192) | def apply_test(self, df:DataFrame): FILE: fastai/text/data.py class LanguageModelPreLoader (line 16) | class LanguageModelPreLoader(Callback): class CircularIndex (line 19) | class CircularIndex(): method __init__ (line 21) | def __init__(self, length:int, forward:bool): self.idx, self.forward... method __getitem__ (line 22) | def __getitem__(self, i): method __len__ (line 24) | def __len__(self) -> int: return len(self.idx) method shuffle (line 25) | def shuffle(self): np.random.shuffle(self.idx) method __init__ (line 27) | def __init__(self, dataset:LabelList, lengths:Collection[int]=None, bs... method __len__ (line 33) | def __len__(self): method __getattr__ (line 40) | def __getattr__(self,k:str)->Any: return getattr(self.dataset, k) method allocate_buffers (line 42) | def allocate_buffers(self): method on_epoch_begin (line 53) | def on_epoch_begin(self, **kwargs): method on_epoch_end (line 70) | def on_epoch_end(self, **kwargs): self.on_epoch_begin() method __getitem__ (line 72) | def __getitem__(self, k:int): method fill_row (line 80) | def fill_row(self, forward, items, idx, row, ro, ri, overlap,lengths): class SortSampler (line 99) | class SortSampler(Sampler): method __init__ (line 102) | def __init__(self, data_source:NPArrayList, key:KeyFunc): self.data_so... method __len__ (line 103) | def __len__(self) -> int: return len(self.data_source) method __iter__ (line 104) | def __iter__(self): class SortishSampler (line 107) | class SortishSampler(Sampler): method __init__ (line 110) | def __init__(self, data_source:NPArrayList, key:KeyFunc, bs:int): method __len__ (line 113) | def __len__(self) -> int: return len(self.data_source) method __iter__ (line 115) | def __iter__(self): function pad_collate (line 128) | def pad_collate(samples:BatchSamples, pad_idx:int=1, pad_first:bool=True... function _get_processor (line 140) | def _get_processor(tokenizer:Tokenizer=None, vocab:Vocab=None, chunksize... class TextDataBunch (line 146) | class TextDataBunch(DataBunch): method from_ids (line 150) | def from_ids(cls, path:PathOrStr, vocab:Vocab, train_ids:Collection[Co... method load (line 165) | def load(cls, path:PathOrStr, cache_name:PathOrStr='tmp', processor:Pr... method from_tokens (line 178) | def from_tokens(cls, path:PathOrStr, trn_tok:Collection[Collection[str... method from_df (line 191) | def from_df(cls, path:PathOrStr, train_df:DataFrame, valid_df:DataFram... method from_csv (line 210) | def from_csv(cls, path:PathOrStr, csv_name, valid_pct:float=0.2, test:... method from_folder (line 227) | def from_folder(cls, path:PathOrStr, train:str='train', valid:str='val... class TextLMDataBunch (line 240) | class TextLMDataBunch(TextDataBunch): method create (line 243) | def create(cls, train_ds, valid_ds, test_ds=None, path:PathOrStr='.', ... class TextClasDataBunch (line 255) | class TextClasDataBunch(TextDataBunch): method create (line 258) | def create(cls, train_ds, valid_ds, test_ds=None, path:PathOrStr='.', ... function open_text (line 274) | def open_text(fn:PathOrStr, enc='utf-8'): class Text (line 278) | class Text(ItemBase): method __init__ (line 280) | def __init__(self, ids, text): self.data,self.text = np.array(ids, dty... method __str__ (line 281) | def __str__(self): return str(self.text) class TokenizeProcessor (line 283) | class TokenizeProcessor(PreProcessor): method __init__ (line 285) | def __init__(self, ds:ItemList=None, tokenizer:Tokenizer=None, chunksi... method process_one (line 290) | def process_one(self, item): method process (line 293) | def process(self, ds): class NumericalizeProcessor (line 300) | class NumericalizeProcessor(PreProcessor): method __init__ (line 302) | def __init__(self, ds:ItemList=None, vocab:Vocab=None, max_vocab:int=6... method process_one (line 306) | def process_one(self,item): return np.array(self.vocab.numericalize(it... method process (line 307) | def process(self, ds): class OpenFileProcessor (line 312) | class OpenFileProcessor(PreProcessor): method process (line 314) | def process(self, ds:Collection): ds.items = array([self.process_one(i... method process_one (line 315) | def process_one(self,item): return open_text(item) if isinstance(item,... class TextList (line 317) | class TextList(ItemList): method __init__ (line 323) | def __init__(self, items:Iterator, vocab:Vocab=None, pad_idx:int=1, se... method get (line 328) | def get(self, i): method label_for_lm (line 332) | def label_for_lm(self, **kwargs): method reconstruct (line 338) | def reconstruct(self, t:Tensor): method from_folder (line 344) | def from_folder(cls, path:PathOrStr='.', extensions:Collection[str]=te... method show_xys (line 350) | def show_xys(self, xs, ys, max_len:int=70)->None: method show_xyzs (line 363) | def show_xyzs(self, xs, ys, zs, max_len:int=70): class LMLabelList (line 375) | class LMLabelList(EmptyLabelList): method __init__ (line 377) | def __init__(self, items:Iterator, **kwargs): class LMTextList (line 381) | class LMTextList(TextList): function _join_texts (line 386) | def _join_texts(texts:Collection[str], mark_fields:bool=False, include_b... function apply_rules (line 397) | def apply_rules(text, pre_rules=None, post_rules=None): function get_default_size (line 405) | def get_default_size(texts, max_vocab_sz): function train_sentencepiece (line 418) | def train_sentencepiece(texts:Collection[str], path:PathOrStr, pre_rules... class SPProcessor (line 438) | class SPProcessor(PreProcessor): method __init__ (line 440) | def __init__(self, ds:ItemList=None, pre_rules: ListRules=None, post_r... method process_one (line 454) | def process_one(self, item, join=True): method process (line 459) | def process(self, ds): method _encode_batch (line 474) | def _encode_batch(self, texts): method load (line 481) | def load(cls, path:PathOrStr, tmp_dir:PathOrStr='tmp', name:str='spm'): FILE: fastai/text/interpret.py function value2rgba (line 9) | def value2rgba(x:float, cmap:Callable=cm.RdYlGn, alpha_mult:float=1.0)->... function piece_attn_html (line 16) | def piece_attn_html(pieces:List[str], attns:List[float], sep:str=' ', **... function show_piece_attn (line 26) | def show_piece_attn(*args, **kwargs): function _eval_dropouts (line 30) | def _eval_dropouts(mod): class TextClassificationInterpretation (line 35) | class TextClassificationInterpretation(ClassificationInterpretation): method __init__ (line 40) | def __init__(self, learn: Learner, preds: Tensor, y_true: Tensor, loss... method from_learner (line 45) | def from_learner(cls, learn: Learner, ds_type:DatasetType=DatasetType... method intrinsic_attention (line 50) | def intrinsic_attention(self, text:str, class_id:int=None): method html_intrinsic_attention (line 70) | def html_intrinsic_attention(self, text:str, class_id:int=None, **kwar... method show_intrinsic_attention (line 74) | def show_intrinsic_attention(self, text:str, class_id:int=None, **kwar... method show_top_losses (line 78) | def show_top_losses(self, k:int, max_len:int=70)->None: FILE: fastai/text/learner.py function convert_weights (line 28) | def convert_weights(wgts:Weights, stoi_wgts:Dict[str,int], itos_new:Coll... class RNNLearner (line 45) | class RNNLearner(Learner): method __init__ (line 47) | def __init__(self, data:DataBunch, model:nn.Module, split_func:OptSpli... method save_encoder (line 57) | def save_encoder(self, name:str): method load_encoder (line 64) | def load_encoder(self, name:str, device:torch.device=None): method load_pretrained (line 72) | def load_pretrained(self, wgts_fname:str, itos_fname:str, strict:bool=... method get_preds (line 81) | def get_preds(self, ds_type:DatasetType=DatasetType.Valid, activ:nn.Mo... function decode_spec_tokens (line 94) | def decode_spec_tokens(tokens): class LanguageLearner (line 113) | class LanguageLearner(RNNLearner): method predict (line 116) | def predict(self, text:str, n_words:int=1, no_unk:bool=True, temperatu... method beam_search (line 137) | def beam_search(self, text:str, n_words:int, no_unk:bool=True, top_k:i... method show_results (line 165) | def show_results(self, ds_type=DatasetType.Valid, rows:int=5, max_len:... function get_language_model (line 187) | def get_language_model(arch:Callable, vocab_sz:int, config:dict=None, dr... function language_model_learner (line 201) | def language_model_learner(data:DataBunch, arch, config:dict=None, drop_... function masked_concat_pool (line 221) | def masked_concat_pool(outputs, mask): class PoolingLinearClassifier (line 230) | class PoolingLinearClassifier(Module): method __init__ (line 232) | def __init__(self, layers:Collection[int], drops:Collection[float]): method forward (line 240) | def forward(self, input:Tuple[Tensor,Tensor, Tensor])->Tuple[Tensor,Te... class MultiBatchEncoder (line 246) | class MultiBatchEncoder(Module): method __init__ (line 248) | def __init__(self, bptt:int, max_len:int, module:nn.Module, pad_idx:in... method concat (line 251) | def concat(self, arrs:Collection[Tensor])->Tensor: method reset (line 255) | def reset(self): method forward (line 258) | def forward(self, input:LongTensor)->Tuple[Tensor,Tensor]: function get_text_classifier (line 270) | def get_text_classifier(arch:Callable, vocab_sz:int, n_class:int, bptt:i... function text_classifier_learner (line 287) | def text_classifier_learner(data:DataBunch, arch:Callable, bptt:int=70, ... FILE: fastai/text/models/awd_lstm.py function dropout_mask (line 13) | def dropout_mask(x:Tensor, sz:Collection[int], p:float): class RNNDropout (line 17) | class RNNDropout(Module): method __init__ (line 20) | def __init__(self, p:float=0.5): self.p=p method forward (line 22) | def forward(self, x:Tensor)->Tensor: class WeightDropout (line 27) | class WeightDropout(Module): method __init__ (line 30) | def __init__(self, module:nn.Module, weight_p:float, layer_names:Colle... method _setweights (line 38) | def _setweights(self): method forward (line 44) | def forward(self, *args:ArgStar): method reset (line 51) | def reset(self): class EmbeddingDropout (line 57) | class EmbeddingDropout(Module): method __init__ (line 60) | def __init__(self, emb:nn.Module, embed_p:float): method forward (line 65) | def forward(self, words:LongTensor, scale:Optional[float]=None)->Tensor: class AWD_LSTM (line 75) | class AWD_LSTM(Module): method __init__ (line 80) | def __init__(self, vocab_sz:int, emb_sz:int, n_hid:int, n_layers:int, ... method forward (line 103) | def forward(self, input:Tensor, from_embeddings:bool=False)->Tuple[Ten... method _one_hidden (line 120) | def _one_hidden(self, l:int)->Tensor: method select_hidden (line 125) | def select_hidden(self, idxs): method reset (line 130) | def reset(self): class LinearDecoder (line 136) | class LinearDecoder(Module): method __init__ (line 140) | def __init__(self, n_out:int, n_hid:int, output_p:float, tie_encoder:n... method forward (line 147) | def forward(self, input:Tuple[Tensor,Tensor])->Tuple[Tensor,Tensor,Ten... class SequentialRNN (line 153) | class SequentialRNN(nn.Sequential): method reset (line 155) | def reset(self): function awd_lstm_lm_split (line 159) | def awd_lstm_lm_split(model:nn.Module) -> List[nn.Module]: function awd_lstm_clas_split (line 164) | def awd_lstm_clas_split(model:nn.Module) -> List[nn.Module]: function value2rgba (line 176) | def value2rgba(x:float, cmap:Callable=cm.RdYlGn, alpha_mult:float=1.0)->... function piece_attn_html (line 183) | def piece_attn_html(pieces:List[str], attns:List[float], sep:str=' ', **... function show_piece_attn (line 193) | def show_piece_attn(*args, **kwargs): function _eval_dropouts (line 197) | def _eval_dropouts(mod): class TextClassificationInterpretation (line 202) | class TextClassificationInterpretation(ClassificationInterpretation): method __init__ (line 207) | def __init__(self, learn: Learner, preds: Tensor, y_true: Tensor, loss... method intrinsic_attention (line 211) | def intrinsic_attention(self, text:str, class_id:int=None): method html_intrinsic_attention (line 231) | def html_intrinsic_attention(self, text:str, class_id:int=None, **kwar... method show_intrinsic_attention (line 235) | def show_intrinsic_attention(self, text:str, class_id:int=None, **kwar... method show_top_losses (line 239) | def show_top_losses(self, k:int, max_len:int=70)->None: FILE: fastai/text/models/bwd_forget_mult_cuda.cpp function bwd_forget_mult_forward (line 14) | at::Tensor bwd_forget_mult_forward(at::Tensor x, at::Tensor f, at::Tenso... function bwd_forget_mult_backward (line 22) | std::vector bwd_forget_mult_backward(at::Tensor x, at::Tenso... function PYBIND11_MODULE (line 28) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: fastai/text/models/forget_mult_cuda.cpp function forget_mult_forward (line 14) | at::Tensor forget_mult_forward(at::Tensor x, at::Tensor f, at::Tensor ou... function forget_mult_backward (line 22) | std::vector forget_mult_backward(at::Tensor x, at::Tensor f,... function PYBIND11_MODULE (line 28) | PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { FILE: fastai/text/models/qrnn.py function dispatch_cuda (line 15) | def dispatch_cuda(cuda_class, cpu_func, x): class ForgetMultGPU (line 18) | class ForgetMultGPU(Function): method forward (line 21) | def forward(ctx, x:Tensor, f:Tensor, hidden_init:Optional[Tensor]=None... method backward (line 38) | def backward(ctx, grad_output): class BwdForgetMultGPU (line 43) | class BwdForgetMultGPU(Function): method forward (line 46) | def forward(ctx, x:Tensor, f:Tensor, hidden_init:Optional[Tensor]=None... method backward (line 63) | def backward(ctx, grad_output:Tensor): function forget_mult_CPU (line 68) | def forget_mult_CPU(x:Tensor, f:Tensor, hidden_init:Optional[Tensor]=Non... class QRNNLayer (line 81) | class QRNNLayer(Module): method __init__ (line 84) | def __init__(self, input_size:int, hidden_size:int=None, save_prev_x:b... method reset (line 96) | def reset(self): method forward (line 100) | def forward(self, inp, hid=None): method _get_source (line 120) | def _get_source(self, inp): class QRNN (line 129) | class QRNN(Module): method __init__ (line 132) | def __init__(self, input_size:int, hidden_size:int, n_layers:int=1, bi... method reset (line 148) | def reset(self): method forward (line 154) | def forward(self, inp, hid=None): FILE: fastai/text/models/transformer.py class PositionalEncoding (line 11) | class PositionalEncoding(Module): method __init__ (line 13) | def __init__(self, d:int): self.register_buffer('freq', 1 / (10000 ** ... method forward (line 15) | def forward(self, pos:Tensor): class GeLU (line 20) | class GeLU(Module): method forward (line 21) | def forward(self, x): return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / m... class Swish (line 23) | class Swish(Module): method forward (line 24) | def forward(self, x): return x * torch.sigmoid(x) function feed_forward (line 28) | def feed_forward(d_model:int, d_ff:int, ff_p:float=0., act:Activation=Ac... class MultiHeadAttention (line 33) | class MultiHeadAttention(Module): method __init__ (line 35) | def __init__(self, n_heads:int, d_model:int, d_head:int=None, resid_p:... method forward (line 44) | def forward(self, x:Tensor, mask:Tensor=None, **kwargs): method _apply_attention (line 47) | def _apply_attention(self, x:Tensor, mask:Tensor=None): method _attention_einsum (line 60) | def _attention_einsum(self, x, mask=None): function _line_shift (line 81) | def _line_shift(x:Tensor, mask:bool=False): class MultiHeadRelativeAttention (line 89) | class MultiHeadRelativeAttention(MultiHeadAttention): method __init__ (line 92) | def __init__(self, n_heads:int, d_model:int, d_head:int, resid_p:float... method _apply_attention (line 97) | def _apply_attention(self, x:Tensor, r:Tensor=None, u:Tensor=None, v:T... method _attention_einsum (line 119) | def _attention_einsum(self, x:Tensor, r:Tensor=None, u:Tensor=None, v:... class DecoderLayer (line 138) | class DecoderLayer(Module): method __init__ (line 141) | def __init__(self, n_heads:int, d_model:int, d_head:int, d_inner:int, ... method forward (line 147) | def forward(self, x:Tensor, mask:Tensor=None, **kwargs): return self.f... class Transformer (line 149) | class Transformer(Module): method __init__ (line 151) | def __init__(self, vocab_sz:int, ctx_len:int, n_layers:int, n_heads:in... method reset (line 163) | def reset(self): pass method forward (line 165) | def forward(self, x): class TransformerXL (line 174) | class TransformerXL(Module): method __init__ (line 176) | def __init__(self, vocab_sz:int, ctx_len:int, n_layers:int, n_heads:in... method reset (line 191) | def reset(self): method _update_mems (line 195) | def _update_mems(self, hids): method select_hidden (line 203) | def select_hidden(self, idxs): self.hidden = [h[idxs] for h in self.hi... method forward (line 205) | def forward(self, x): function init_transformer (line 228) | def init_transformer(m): function tfmer_lm_split (line 248) | def tfmer_lm_split(model:nn.Module) -> List[nn.Module]: function tfmer_clas_split (line 255) | def tfmer_clas_split(model:nn.Module) -> List[nn.Module]: function tfmerXL_lm_split (line 270) | def tfmerXL_lm_split(model:nn.Module) -> List[nn.Module]: function tfmerXL_clas_split (line 277) | def tfmerXL_clas_split(model:nn.Module) -> List[nn.Module]: FILE: fastai/text/transform.py class BaseTokenizer (line 16) | class BaseTokenizer(): method __init__ (line 18) | def __init__(self, lang:str): self.lang = lang method tokenizer (line 19) | def tokenizer(self, t:str) -> List[str]: return t.split(' ') method add_special_cases (line 20) | def add_special_cases(self, toks:Collection[str]): pass class SpacyTokenizer (line 22) | class SpacyTokenizer(BaseTokenizer): method __init__ (line 24) | def __init__(self, lang:str): method tokenizer (line 27) | def tokenizer(self, t:str) -> List[str]: method add_special_cases (line 30) | def add_special_cases(self, toks:Collection[str]): function spec_add_spaces (line 34) | def spec_add_spaces(t:str) -> str: function rm_useless_spaces (line 38) | def rm_useless_spaces(t:str) -> str: function replace_rep (line 42) | def replace_rep(t:str) -> str: function replace_wrep (line 50) | def replace_wrep(t:str) -> str: function fix_html (line 58) | def fix_html(x:str) -> str: function replace_all_caps (line 67) | def replace_all_caps(x:Collection[str]) -> Collection[str]: function deal_caps (line 75) | def deal_caps(x:Collection[str]) -> Collection[str]: class Tokenizer (line 87) | class Tokenizer(): method __init__ (line 89) | def __init__(self, tok_func:Callable=SpacyTokenizer, lang:str='en', pr... method __repr__ (line 97) | def __repr__(self) -> str: method process_text (line 103) | def process_text(self, t:str, tok:BaseTokenizer) -> List[str]: method _process_all_1 (line 110) | def _process_all_1(self, texts:Collection[str]) -> List[List[str]]: method process_all (line 116) | def process_all(self, texts:Collection[str]) -> List[List[str]]: class Vocab (line 122) | class Vocab(): method __init__ (line 124) | def __init__(self, itos:Collection[str]): method numericalize (line 128) | def numericalize(self, t:Collection[str]) -> List[int]: method textify (line 132) | def textify(self, nums:Collection[int], sep=' ') -> List[str]: method __getstate__ (line 136) | def __getstate__(self): method __setstate__ (line 139) | def __setstate__(self, state:dict): method save (line 143) | def save(self, path): method create (line 148) | def create(cls, tokens:Tokens, max_vocab:int, min_freq:int) -> 'Vocab': method load (line 161) | def load(cls, path): FILE: fastai/torch_core.py function is_pool_type (line 64) | def is_pool_type(l:Callable): return re.search(r'Pool[123]d$', l.__class... function _new_torch_cuda_set_device (line 71) | def _new_torch_cuda_set_device(device): function tensor (line 76) | def tensor(x:Any, *rest)->Tensor: class Module (line 87) | class Module(nn.Module, metaclass=PrePostInitMeta): method __pre_init__ (line 89) | def __pre_init__(self): super().__init__() method __init__ (line 90) | def __init__(self): pass function np_address (line 92) | def np_address(x:np.ndarray)->int: function to_detach (line 96) | def to_detach(b:Tensors, cpu:bool=True): function to_data (line 104) | def to_data(b:ItemsList): function to_cpu (line 108) | def to_cpu(b:ItemsList): function to_half (line 112) | def to_half(b:Collection[Tensor])->Collection[Tensor]: function to_float (line 116) | def to_float(b:Collection[Tensor])->Collection[Tensor]: function to_device (line 120) | def to_device(b:Tensors, device:torch.device): function data_collate (line 125) | def data_collate(batch:ItemsList)->Tensor: function requires_grad (line 129) | def requires_grad(m:nn.Module, b:Optional[bool]=None)->Optional[bool]: function trainable_params (line 136) | def trainable_params(m:nn.Module)->ParamList: function children (line 141) | def children(m:nn.Module)->ModuleList: function num_children (line 145) | def num_children(m:nn.Module)->int: function range_children (line 149) | def range_children(m:nn.Module)->Iterator[int]: class ParameterModule (line 153) | class ParameterModule(Module): method __init__ (line 155) | def __init__(self, p:nn.Parameter): self.val = p method forward (line 156) | def forward(self, x): return x function children_and_parameters (line 158) | def children_and_parameters(m:nn.Module): function flatten_model (line 166) | def flatten_model(m:nn.Module): function first_layer (line 175) | def first_layer(m:nn.Module)->nn.Module: function last_layer (line 179) | def last_layer(m:nn.Module)->nn.Module: function split_model_idx (line 183) | def split_model_idx(model:nn.Module, idxs:Collection[int])->ModuleList: function split_model (line 190) | def split_model(model:nn.Module=None, splits:Collection[Union[nn.Module,... function get_param_groups (line 199) | def get_param_groups(layer_groups:Collection[nn.Module])->List[List[nn.P... function split_no_wd_params (line 202) | def split_no_wd_params(layer_groups:Collection[nn.Module])->List[List[nn... function set_bn_eval (line 220) | def set_bn_eval(m:nn.Module)->None: function batch_to_half (line 227) | def batch_to_half(b:Collection[Tensor])->Collection[Tensor]: function bn2float (line 231) | def bn2float(module:nn.Module)->nn.Module: function model2half (line 237) | def model2half(model:nn.Module)->nn.Module: function init_default (line 241) | def init_default(m:nn.Module, func:LayerFunc=nn.init.kaiming_normal_)->n... function cond_init (line 248) | def cond_init(m:nn.Module, init_func:LayerFunc): function apply_leaf (line 252) | def apply_leaf(m:nn.Module, f:LayerFunc): function apply_init (line 258) | def apply_init(m, init_func:LayerFunc): function in_channels (line 262) | def in_channels(m:nn.Module) -> List[int]: class ModelOnCPU (line 268) | class ModelOnCPU(): method __init__ (line 270) | def __init__(self, model:nn.Module): self.model = model method __enter__ (line 271) | def __enter__(self): method __exit__ (line 274) | def __exit__(self, type, value, traceback): class NoneReduceOnCPU (line 277) | class NoneReduceOnCPU(): method __init__ (line 279) | def __init__(self, loss_func:LossFunction): method __enter__ (line 282) | def __enter__(self): method __exit__ (line 292) | def __exit__(self, type, value, traceback): function model_type (line 296) | def model_type(dtype): function np2model_tensor (line 302) | def np2model_tensor(a): function _pca (line 309) | def _pca(x, k=2): function trange_of (line 316) | def trange_of(x): function to_np (line 320) | def to_np(x): function tensor__array__ (line 325) | def tensor__array__(self, dtype=None): function grab_idx (line 332) | def grab_idx(x,i,batch_first:bool=True): function logit (line 337) | def logit(x:Tensor)->Tensor: function logit_ (line 342) | def logit_(x:Tensor)->Tensor: function set_all_seed (line 347) | def set_all_seed(seed:int)->None: function uniform (line 353) | def uniform(low:Number, high:Number=None, size:Optional[List[int]]=None)... function log_uniform (line 358) | def log_uniform(low, high, size:Optional[List[int]]=None)->FloatOrTensor: function rand_bool (line 363) | def rand_bool(p:float, size:Optional[List[int]]=None)->BoolOrTensor: function uniform_int (line 367) | def uniform_int(low:int, high:int, size:Optional[List[int]]=None)->IntOr... function one_param (line 371) | def one_param(m: nn.Module)->Tensor: function try_int (line 375) | def try_int(o:Any)->Any: function get_model (line 383) | def get_model(model:nn.Module): function flatten_check (line 387) | def flatten_check(out:Tensor, targ:Tensor) -> Tensor: function _data_parallel_reset (line 394) | def _data_parallel_reset(self): function remove_module_load (line 398) | def remove_module_load(state_dict): function num_distrib (line 404) | def num_distrib(): function rank_distrib (line 408) | def rank_distrib(): function add_metrics (line 412) | def add_metrics(last_metrics:Collection[Rank0Tensor], mets:Union[Rank0Te... function try_save (line 417) | def try_save(state:Dict, path:Path=None, file:PathLikeOrBinaryStream=None): function np_func (line 423) | def np_func(f): FILE: fastai/train.py function one_cycle_scheduler (line 10) | def one_cycle_scheduler(lr_max:float, **kwargs:Any)->OneCycleScheduler: function fit_one_cycle (line 14) | def fit_one_cycle(learn:Learner, cyc_len:int, max_lr:Union[Floats,slice]... function lr_find (line 25) | def lr_find(learn:Learner, start_lr:Floats=1e-7, end_lr:Floats=10, num_i... function to_fp16 (line 36) | def to_fp16(learn:Learner, loss_scale:float=None, max_noskip:int=1000, d... function to_fp32 (line 47) | def to_fp32(learn:Learner): function mixup (line 55) | def mixup(learn:Learner, alpha:float=0.4, stack_x:bool=False, stack_y:bo... class ShowGraph (line 66) | class ShowGraph(LearnerCallback): method on_epoch_end (line 68) | def on_epoch_end(self, n_epochs:int, last_metrics:MetricsList, **kwarg... class BnFreeze (line 79) | class BnFreeze(LearnerCallback): method on_epoch_begin (line 81) | def on_epoch_begin(self, **kwargs:Any)->None: class GradientClipping (line 85) | class GradientClipping(LearnerCallback): method __init__ (line 87) | def __init__(self, learn:Learner, clip:float = 0.): method on_backward_end (line 91) | def on_backward_end(self, **kwargs): function clip_grad (line 95) | def clip_grad(learn:Learner, clip:float=0.1)->Learner: class AccumulateScheduler (line 101) | class AccumulateScheduler(LearnerCallback): method __init__ (line 104) | def __init__(self, learn:Learner, n_step:int = 1, drop_last:bool = Fal... method on_train_begin (line 108) | def on_train_begin(self, **kwargs): method on_epoch_begin (line 113) | def on_epoch_begin(self, **kwargs): method on_batch_begin (line 117) | def on_batch_begin(self, last_input, last_target, **kwargs): method on_backward_end (line 122) | def on_backward_end(self, **kwargs): method on_epoch_end (line 130) | def on_epoch_end(self, **kwargs): class Interpretation (line 138) | class Interpretation(): method __init__ (line 140) | def __init__(self, learn:Learner, preds:Tensor, y_true:Tensor, losses:... method from_learner (line 150) | def from_learner(cls, learn: Learner, ds_type:DatasetType=DatasetType... method top_losses (line 155) | def top_losses(self, k:int=None, largest=True): class ClassificationInterpretation (line 165) | class ClassificationInterpretation(Interpretation): method __init__ (line 167) | def __init__(self, learn:Learner, preds:Tensor, y_true:Tensor, losses:... method confusion_matrix (line 171) | def confusion_matrix(self, slice_size:int=1): method plot_confusion_matrix (line 183) | def plot_confusion_matrix(self, normalize:bool=False, title:str='Confu... method most_confused (line 208) | def most_confused(self, min_val:int=1, slice_size:int=1)->Collection[T... function _learner_interpret (line 217) | def _learner_interpret(learn:Learner, ds_type:DatasetType=DatasetType.Va... class MultiLabelClassificationInterpretation (line 222) | class MultiLabelClassificationInterpretation(Interpretation): method __init__ (line 224) | def __init__(self, learn:Learner, preds:Tensor, y_true:Tensor, losses:... FILE: fastai/utils/collect_env.py function get_env (line 11) | def get_env(name): function show_install (line 16) | def show_install(show_nvidia_smi:bool=False): function pypi_module_version_is_available (line 129) | def pypi_module_version_is_available(module, version): function check_perf (line 150) | def check_perf(): FILE: fastai/utils/ipython.py function is_in_ipython (line 5) | def is_in_ipython(): function is_in_colab (line 19) | def is_in_colab(): function get_ref_free_exc_info (line 29) | def get_ref_free_exc_info(): function gpu_mem_restore (line 35) | def gpu_mem_restore(func): class gpu_mem_restore_ctx (line 57) | class gpu_mem_restore_ctx(): method __enter__ (line 59) | def __enter__(self): return self method __exit__ (line 60) | def __exit__(self, exc_type, exc_val, exc_tb): FILE: fastai/utils/mem.py function preload_pytorch (line 18) | def preload_pytorch(): function b2mb (line 21) | def b2mb(num): function gpu_mem_get (line 25) | def gpu_mem_get(id=None): function gpu_mem_get_all (line 36) | def gpu_mem_get_all(): function gpu_mem_get_free (line 41) | def gpu_mem_get_free(): function gpu_mem_get_free_no_cache (line 45) | def gpu_mem_get_free_no_cache(): function gpu_mem_get_used (line 50) | def gpu_mem_get_used(): function gpu_mem_get_used_fast (line 54) | def gpu_mem_get_used_fast(gpu_handle): function gpu_mem_get_used_no_cache (line 59) | def gpu_mem_get_used_no_cache(): function gpu_with_max_free_mem (line 64) | def gpu_with_max_free_mem(): class GPUMemTrace (line 72) | class GPUMemTrace(): method __init__ (line 74) | def __init__(self, silent=False, ctx=None, on_exit_report=True): method reset (line 81) | def reset(self): method data_set (line 85) | def data_set(self): method data (line 100) | def data(self): method start (line 104) | def start(self): method stop (line 109) | def stop(self): method __enter__ (line 114) | def __enter__(self): method __exit__ (line 118) | def __exit__(self, *exc): method __del__ (line 122) | def __del__(self): method __repr__ (line 125) | def __repr__(self): method _get_ctx (line 129) | def _get_ctx(self, subctx=None): method silent (line 136) | def silent(self, silent=True): method report (line 139) | def report(self, subctx=None): method report_n_reset (line 144) | def report_n_reset(self, subctx=None): method peak_monitor_start (line 149) | def peak_monitor_start(self): method peak_monitor_stop (line 157) | def peak_monitor_stop(self): method peak_monitor_func (line 162) | def peak_monitor_func(self): function gpu_mem_trace (line 169) | def gpu_mem_trace(func): function reduce_mem_usage (line 177) | def reduce_mem_usage(df): FILE: fastai/utils/mod_display.py class progress_disabled_ctx (line 10) | class progress_disabled_ctx(): method __init__ (line 12) | def __init__(self,learn:Learner): method __enter__ (line 15) | def __enter__(self): method __exit__ (line 26) | def __exit__(self, *args): FILE: fastai/utils/pynvml_gate.py function _LoadNvmlLibrary (line 18) | def _LoadNvmlLibrary(): function load_pynvml_env (line 51) | def load_pynvml_env(): FILE: fastai/utils/show_install.py function main (line 6) | def main(show_nvidia_smi:Param(opt=False, nargs='?', type=bool)=False): FILE: fastai/vision/cyclegan.py function convT_norm_relu (line 8) | def convT_norm_relu(ch_in:int, ch_out:int, norm_layer:nn.Module, ks:int=... function pad_conv_norm_relu (line 12) | def pad_conv_norm_relu(ch_in:int, ch_out:int, pad_mode:str, norm_layer:n... class ResnetBlock (line 26) | class ResnetBlock(Module): method __init__ (line 27) | def __init__(self, dim:int, pad_mode:str='reflection', norm_layer:nn.M... method forward (line 35) | def forward(self, x): return x + self.conv_block(x) function resnet_generator (line 37) | def resnet_generator(ch_in:int, ch_out:int, n_ftrs:int=64, norm_layer:nn... function conv_norm_lr (line 52) | def conv_norm_lr(ch_in:int, ch_out:int, norm_layer:nn.Module=None, ks:in... function critic (line 63) | def critic(ch_in:int, n_ftrs:int=64, n_layers:int=3, norm_layer:nn.Modul... class CycleGAN (line 77) | class CycleGAN(Module): method __init__ (line 79) | def __init__(self, ch_in:int, ch_out:int, n_features:int=64, disc_laye... method forward (line 90) | def forward(self, real_A, real_B): class AdaptiveLoss (line 96) | class AdaptiveLoss(Module): method __init__ (line 97) | def __init__(self, crit): self.crit = crit method forward (line 99) | def forward(self, output, target:bool): class CycleGanLoss (line 103) | class CycleGanLoss(Module): method __init__ (line 104) | def __init__(self, cgan:nn.Module, lambda_A:float=10., lambda_B:float=... method set_input (line 109) | def set_input(self, input): method forward (line 112) | def forward(self, output, target): class CycleGANTrainer (line 124) | class CycleGANTrainer(LearnerCallback): method _set_trainable (line 127) | def _set_trainable(self, D_A=False, D_B=False): method on_train_begin (line 139) | def on_train_begin(self, **kwargs): method on_batch_begin (line 154) | def on_batch_begin(self, last_input, **kwargs): method on_batch_end (line 158) | def on_batch_end(self, last_input, last_output, **kwargs): method on_epoch_end (line 177) | def on_epoch_end(self, last_metrics, **kwargs): FILE: fastai/vision/data.py function get_image_files (line 20) | def get_image_files(c:PathOrStr, check_ext:bool=True, recurse=False)->Fi... function get_annotations (line 24) | def get_annotations(fname, prefix=None): function bb_pad_collate (line 41) | def bb_pad_collate(samples:BatchSamples, pad_idx:int=0) -> Tuple[FloatTe... function normalize (line 56) | def normalize(x:TensorImage, mean,std:Tensor)->TensorImage: function denormalize (line 60) | def denormalize(x:TensorImage, mean,std:Tensor, do_x:bool=True)->TensorI... function _normalize_batch (line 64) | def _normalize_batch(b:Tuple[Tensor,Tensor], mean:Tensor, std:Tensor, do... function normalize_funcs (line 72) | def normalize_funcs(mean:Tensor, std:Tensor, do_x:bool=True, do_y:bool=F... function channel_view (line 83) | def channel_view(x:Tensor)->Tensor: class ImageDataBunch (line 87) | class ImageDataBunch(DataBunch): method create_from_ll (line 92) | def create_from_ll(cls, lls:LabelLists, bs:int=64, val_bs:int=None, ds... method from_folder (line 105) | def from_folder(cls, path:PathOrStr, train:PathOrStr='train', valid:Pa... method from_df (line 116) | def from_df(cls, path:PathOrStr, df:pd.DataFrame, folder:PathOrStr=Non... method from_csv (line 125) | def from_csv(cls, path:PathOrStr, folder:PathOrStr=None, label_delim:s... method from_lists (line 135) | def from_lists(cls, path:PathOrStr, fnames:FilePathList, labels:Collec... method from_name_func (line 145) | def from_name_func(cls, path:PathOrStr, fnames:FilePathList, label_fun... method from_name_re (line 152) | def from_name_re(cls, path:PathOrStr, fnames:FilePathList, pat:str, va... method single_from_classes (line 163) | def single_from_classes(path:Union[Path, str], classes:Collection[str]... method batch_stats (line 170) | def batch_stats(self, funcs:Collection[Callable]=None, ds_type:Dataset... method normalize (line 176) | def normalize(self, stats:Collection[Tensor]=None, do_x:bool=True, do_... function download_image (line 185) | def download_image(url,dest, timeout=4): function _download_image_inner (line 189) | def _download_image_inner(dest, url, i, timeout=4): function download_images (line 194) | def download_images(urls:Collection[str], dest:PathOrStr, max_pics:int=1... function resize_to (line 201) | def resize_to(img, targ_sz:int, use_min:bool=False): function verify_image (line 208) | def verify_image(file:Path, idx:int, delete:bool, max_size:Union[int,Tup... function verify_images (line 245) | def verify_images(path:PathOrStr, delete:bool=True, max_workers:int=4, m... class ImageList (line 258) | class ImageList(ItemList): method __init__ (line 261) | def __init__(self, *args, convert_mode='RGB', after_open:Callable=None... method open (line 267) | def open(self, fn): method get (line 271) | def get(self, i): method from_folder (line 278) | def from_folder(cls, path:PathOrStr='.', extensions:Collection[str]=No... method from_df (line 284) | def from_df(cls, df:DataFrame, path:PathOrStr, cols:IntsOrStrs=0, fold... method from_csv (line 294) | def from_csv(cls, path:PathOrStr, csv_name:str, header:str='infer', de... method reconstruct (line 300) | def reconstruct(self, t:Tensor): return Image(t.float().clamp(min=0,ma... method show_xys (line 302) | def show_xys(self, xs, ys, imgsize:int=4, figsize:Optional[Tuple[int,i... method show_xyzs (line 310) | def show_xyzs(self, xs, ys, zs, imgsize:int=4, figsize:Optional[Tuple[... class ObjectCategoryProcessor (line 325) | class ObjectCategoryProcessor(MultiCategoryProcessor): method __init__ (line 327) | def __init__(self, ds:ItemList, pad_idx:int=0): method process (line 332) | def process(self, ds:ItemList): method process_one (line 336) | def process_one(self,item): return [item[0], [self.c2i.get(o,None) for... method generate_classes (line 338) | def generate_classes(self, items): function _get_size (line 344) | def _get_size(xs,i): class ObjectCategoryList (line 352) | class ObjectCategoryList(MultiCategoryList): method get (line 356) | def get(self, i): method analyze_pred (line 359) | def analyze_pred(self, pred): return pred method reconstruct (line 361) | def reconstruct(self, t, x): class ObjectItemList (line 368) | class ObjectItemList(ImageList): class SegmentationProcessor (line 372) | class SegmentationProcessor(PreProcessor): method __init__ (line 374) | def __init__(self, ds:ItemList): self.classes = ds.classes method process (line 375) | def process(self, ds:ItemList): ds.classes,ds.c = self.classes,len(se... class SegmentationLabelList (line 377) | class SegmentationLabelList(ImageList): method __init__ (line 380) | def __init__(self, items:Iterator, classes:Collection=None, **kwargs): method open (line 385) | def open(self, fn): return open_mask(fn) method analyze_pred (line 386) | def analyze_pred(self, pred, thresh:float=0.5): return pred.argmax(dim... method reconstruct (line 387) | def reconstruct(self, t:Tensor): return ImageSegment(t) class SegmentationItemList (line 389) | class SegmentationItemList(ImageList): class PointsProcessor (line 393) | class PointsProcessor(PreProcessor): method __init__ (line 395) | def __init__(self, ds:ItemList): self.c = len(ds.items[0].reshape(-1)) method process (line 396) | def process(self, ds:ItemList): ds.c = self.c class PointsLabelList (line 398) | class PointsLabelList(ItemList): method __init__ (line 401) | def __init__(self, items:Iterator, **kwargs): method get (line 405) | def get(self, i): method analyze_pred (line 409) | def analyze_pred(self, pred, thresh:float=0.5): return pred.view(-1,2) method reconstruct (line 410) | def reconstruct(self, t, x): return ImagePoints(FlowField(x.size, t), ... class PointsItemList (line 412) | class PointsItemList(ImageList): class ImageImageList (line 416) | class ImageImageList(ImageList): method show_xys (line 420) | def show_xys(self, xs, ys, imgsize:int=4, figsize:Optional[Tuple[int,i... method show_xyzs (line 428) | def show_xyzs(self, xs, ys, zs, imgsize:int=4, figsize:Optional[Tuple[... function _ll_pre_transform (line 438) | def _ll_pre_transform(self, train_tfm:List[Callable], valid_tfm:List[Cal... function _db_pre_transform (line 444) | def _db_pre_transform(self, train_tfm:List[Callable], valid_tfm:List[Cal... function _presize (line 450) | def _presize(self, size:int, val_xtra_size:int=32, scale:Tuple[float]=(0... FILE: fastai/vision/gan.py function AvgFlatten (line 13) | def AvgFlatten(): function basic_critic (line 17) | def basic_critic(in_size:int, n_channels:int, n_features:int=64, n_extra... function basic_generator (line 28) | def basic_generator(in_size:int, n_channels:int, noise_sz:int=100, n_fea... class GANModule (line 41) | class GANModule(Module): method __init__ (line 43) | def __init__(self, generator:nn.Module=None, critic:nn.Module=None, ge... method forward (line 47) | def forward(self, *args): method switch (line 50) | def switch(self, gen_mode:bool=None): class GANLoss (line 54) | class GANLoss(GANModule): method __init__ (line 56) | def __init__(self, loss_funcG:Callable, loss_funcC:Callable, gan_model... method generator (line 60) | def generator(self, output, target): method critic (line 65) | def critic(self, real_pred, input): class GANTrainer (line 71) | class GANTrainer(LearnerCallback): method __init__ (line 74) | def __init__(self, learn:Learner, switch_eval:bool=False, clip:float=N... method _set_trainable (line 80) | def _set_trainable(self): method on_train_begin (line 89) | def on_train_begin(self, **kwargs): method on_train_end (line 105) | def on_train_end(self, **kwargs): method on_batch_begin (line 109) | def on_batch_begin(self, last_input, last_target, **kwargs): method on_backward_begin (line 115) | def on_backward_begin(self, last_loss, last_output, **kwargs): method on_epoch_begin (line 126) | def on_epoch_begin(self, epoch, **kwargs): method on_epoch_end (line 130) | def on_epoch_end(self, pbar, epoch, last_metrics, **kwargs): method switch (line 143) | def switch(self, gen_mode:bool=None): class FixedGANSwitcher (line 151) | class FixedGANSwitcher(LearnerCallback): method __init__ (line 153) | def __init__(self, learn:Learner, n_crit:Union[int,Callable]=1, n_gen:... method on_train_begin (line 157) | def on_train_begin(self, **kwargs): method on_batch_end (line 161) | def on_batch_end(self, iteration, **kwargs): class AdaptiveGANSwitcher (line 175) | class AdaptiveGANSwitcher(LearnerCallback): method __init__ (line 177) | def __init__(self, learn:Learner, gen_thresh:float=None, critic_thresh... method on_batch_end (line 181) | def on_batch_end(self, last_loss, **kwargs): function gan_loss_from_func (line 190) | def gan_loss_from_func(loss_gen, loss_crit, weights_gen:Tuple[float,floa... class GANLearner (line 204) | class GANLearner(Learner): method __init__ (line 206) | def __init__(self, data:DataBunch, generator:nn.Module, critic:nn.Modu... method from_learners (line 218) | def from_learners(cls, learn_gen:Learner, learn_crit:Learner, switcher... method wgan (line 225) | def wgan(cls, data:DataBunch, generator:nn.Module, critic:nn.Module, s... class NoisyItem (line 229) | class NoisyItem(ItemBase): method __init__ (line 231) | def __init__(self, noise_sz): self.obj,self.data = noise_sz,torch.rand... method __str__ (line 232) | def __str__(self): return '' method apply_tfms (line 233) | def apply_tfms(self, tfms, **kwargs): return self class GANItemList (line 235) | class GANItemList(ImageList): method __init__ (line 239) | def __init__(self, items, noise_sz:int=100, **kwargs): method get (line 244) | def get(self, i): return NoisyItem(self.noise_sz) method reconstruct (line 245) | def reconstruct(self, t): return NoisyItem(t.size(0)) method show_xys (line 247) | def show_xys(self, xs, ys, imgsize:int=4, figsize:Optional[Tuple[int,i... method show_xyzs (line 251) | def show_xyzs(self, xs, ys, zs, imgsize:int=4, figsize:Optional[Tuple[... function _conv (line 257) | def _conv(ni:int, nf:int, ks:int=3, stride:int=1, **kwargs): function gan_critic (line 260) | def gan_critic(n_channels:int=3, nf:int=128, n_blocks:int=3, p:int=0.15): class GANDiscriminativeLR (line 277) | class GANDiscriminativeLR(LearnerCallback): method __init__ (line 279) | def __init__(self, learn:Learner, mult_lr:float = 5.): method on_batch_begin (line 283) | def on_batch_begin(self, train, **kwargs): method on_step_end (line 287) | def on_step_end(self, **kwargs): class AdaptiveLoss (line 291) | class AdaptiveLoss(Module): method __init__ (line 293) | def __init__(self, crit): method forward (line 296) | def forward(self, output, target): function accuracy_thresh_expand (line 299) | def accuracy_thresh_expand(y_pred:Tensor, y_true:Tensor, thresh:float=0.... FILE: fastai/vision/image.py function pil2tensor (line 14) | def pil2tensor(image:Union[NPImage,NPArray],dtype:np.dtype)->TensorImage: function image2np (line 22) | def image2np(image:Tensor)->np.ndarray: function bb2hw (line 27) | def bb2hw(a:Collection[int])->np.ndarray: function tis2hw (line 31) | def tis2hw(size:Union[int,TensorImageSize]) -> Tuple[int,int]: function _draw_outline (line 36) | def _draw_outline(o:Patch, lw:int): function _draw_rect (line 41) | def _draw_rect(ax:plt.Axes, b:Collection[int], color:str='white', text=N... function _get_default_args (line 49) | def _get_default_args(func:Callable): class FlowField (line 55) | class FlowField(): class Image (line 62) | class Image(ItemBase): method __init__ (line 64) | def __init__(self, px:Tensor): method set_sample (line 71) | def set_sample(self, **kwargs)->'ImageBase': method clone (line 76) | def clone(self): method shape (line 81) | def shape(self)->Tuple[int,int,int]: return self._px.shape method size (line 83) | def size(self)->Tuple[int,int]: return self.shape[-2:] method device (line 85) | def device(self)->torch.device: return self._px.device method __repr__ (line 87) | def __repr__(self): return f'{self.__class__.__name__} {tuple(self.sha... method _repr_png_ (line 88) | def _repr_png_(self): return self._repr_image_format('png') method _repr_jpeg_ (line 89) | def _repr_jpeg_(self): return self._repr_image_format('jpeg') method _repr_image_format (line 91) | def _repr_image_format(self, format_str): method apply_tfms (line 96) | def apply_tfms(self, tfms:TfmList, do_resolve:bool=True, xtra:Optional... method refresh (line 133) | def refresh(self)->None: method save (line 144) | def save(self, fn:PathOrStr): method px (line 150) | def px(self)->TensorImage: method px (line 155) | def px(self,v:TensorImage)->None: method flow (line 160) | def flow(self)->FlowField: method flow (line 170) | def flow(self,v:FlowField): self._flow=v method lighting (line 172) | def lighting(self, func:LightingFunc, *args:Any, **kwargs:Any): method pixel (line 177) | def pixel(self, func:PixelFunc, *args, **kwargs)->'Image': method coord (line 182) | def coord(self, func:CoordFunc, *args, **kwargs)->'Image': method affine (line 187) | def affine(self, func:AffineFunc, *args, **kwargs)->'Image': method resize (line 193) | def resize(self, size:Union[int,TensorImageSize])->'Image': method affine_mat (line 202) | def affine_mat(self)->AffineMatrix: method affine_mat (line 208) | def affine_mat(self,v)->None: self._affine_mat=v method logit_px (line 211) | def logit_px(self)->LogitTensorImage: method logit_px (line 216) | def logit_px(self,v:LogitTensorImage)->None: self._logit_px=v method data (line 219) | def data(self)->TensorImage: method show (line 223) | def show(self, ax:plt.Axes=None, figsize:tuple=(3,3), title:Optional[s... class ImageSegment (line 231) | class ImageSegment(Image): method lighting (line 233) | def lighting(self, func:LightingFunc, *args:Any, **kwargs:Any)->'Image... method refresh (line 235) | def refresh(self): method data (line 240) | def data(self)->TensorImage: method show (line 244) | def show(self, ax:plt.Axes=None, figsize:tuple=(3,3), title:Optional[s... method reconstruct (line 251) | def reconstruct(self, t:Tensor): return ImageSegment(t) class ImagePoints (line 253) | class ImagePoints(Image): method __init__ (line 255) | def __init__(self, flow:FlowField, scale:bool=True, y_first:bool=True): method clone (line 265) | def clone(self): method shape (line 270) | def shape(self)->Tuple[int,int,int]: return (1, *self._flow.size) method size (line 272) | def size(self)->Tuple[int,int]: return self._flow.size method size (line 274) | def size(self, sz:int): self._flow.size=sz method device (line 276) | def device(self)->torch.device: return self._flow.flow.device method __repr__ (line 278) | def __repr__(self): return f'{self.__class__.__name__} {tuple(self.siz... method _repr_image_format (line 279) | def _repr_image_format(self, format_str): return None method flow (line 282) | def flow(self)->FlowField: method flow (line 295) | def flow(self,v:FlowField): self._flow=v method coord (line 297) | def coord(self, func:CoordFunc, *args, **kwargs)->'ImagePoints': method lighting (line 304) | def lighting(self, func:LightingFunc, *args:Any, **kwargs:Any)->'Image... method pixel (line 306) | def pixel(self, func:PixelFunc, *args, **kwargs)->'ImagePoints': method refresh (line 312) | def refresh(self) -> 'ImagePoints': method resize (line 315) | def resize(self, size:Union[int,TensorImageSize]) -> 'ImagePoints': method data (line 322) | def data(self)->Tensor: method show (line 331) | def show(self, ax:plt.Axes=None, figsize:tuple=(3,3), title:Optional[s... class ImageBBox (line 340) | class ImageBBox(ImagePoints): method __init__ (line 342) | def __init__(self, flow:FlowField, scale:bool=True, y_first:bool=True,... method clone (line 350) | def clone(self) -> 'ImageBBox': method create (line 356) | def create(cls, h:int, w:int, bboxes:Collection[Collection[int]], labe... method _compute_boxes (line 367) | def _compute_boxes(self) -> Tuple[LongTensor, LongTensor]: method data (line 378) | def data(self)->Union[FloatTensor, Tuple[FloatTensor,LongTensor]]: method show (line 383) | def show(self, y:Image=None, ax:plt.Axes=None, figsize:tuple=(3,3), ti... function open_image (line 395) | def open_image(fn:PathOrStr, div:bool=True, convert_mode:str='RGB', cls:... function open_mask (line 406) | def open_mask(fn:PathOrStr, div=False, convert_mode='L', after_open:Call... function open_mask_rle (line 410) | def open_mask_rle(mask_rle:str, shape:Tuple[int, int])->ImageSegment: function rle_encode (line 416) | def rle_encode(img:NPArrayMask)->str: function rle_decode (line 423) | def rle_decode(mask_rle:str, shape:Tuple[int,int])->NPArrayMask: function show_image (line 433) | def show_image(img:Image, ax:plt.Axes=None, figsize:tuple=(3,3), hide_ax... function scale_flow (line 441) | def scale_flow(flow, to_unit=True): function _remove_points_out (line 448) | def _remove_points_out(flow:FlowField): class Transform (line 453) | class Transform(): method __init__ (line 457) | def __init__(self, func:Callable, order:Optional[int]=None): method __call__ (line 469) | def __call__(self, *args:Any, p:float=1., is_random:bool=True, use_on_... method calc (line 474) | def calc(self, x:Image, *args:Any, **kwargs:Any)->Image: method name (line 480) | def name(self)->str: return self.__class__.__name__ method __repr__ (line 482) | def __repr__(self)->str: return f'{self.name} ({self.func.__name__})' class RandTransform (line 485) | class RandTransform(): method __post_init__ (line 494) | def __post_init__(self): functools.update_wrapper(self, self.tfm) method resolve (line 496) | def resolve(self)->None: method order (line 521) | def order(self)->int: return self.tfm.order method __call__ (line 523) | def __call__(self, x:Image, *args, **kwargs)->Image: function _resolve_tfms (line 527) | def _resolve_tfms(tfms:TfmList): function _grid_sample (line 531) | def _grid_sample(x:TensorImage, coords:FlowField, mode:str='bilinear', p... function _affine_grid (line 544) | def _affine_grid(size:TensorImageSize)->FlowField: function _affine_mult (line 554) | def _affine_mult(c:FlowField,m:AffineMatrix)->FlowField: function _affine_inv_mult (line 565) | def _affine_inv_mult(c, m): class TfmAffine (line 576) | class TfmAffine(Transform): class TfmPixel (line 579) | class TfmPixel(Transform): class TfmCoord (line 582) | class TfmCoord(Transform): class TfmCrop (line 585) | class TfmCrop(TfmPixel): class TfmLighting (line 588) | class TfmLighting(Transform): function _round_multiple (line 592) | def _round_multiple(x:int, mult:int=None)->int: function _get_crop_target (line 596) | def _get_crop_target(target_px:Union[int,TensorImageSize], mult:int=None... function _get_resize_target (line 601) | def _get_resize_target(img, crop_target, do_crop=False)->TensorImageSize: function plot_flat (line 609) | def plot_flat(r, c, figsize): function plot_multi (line 613) | def plot_multi(func:Callable[[int,int,plt.Axes],None], r:int=1, c:int=1,... function show_multi (line 619) | def show_multi(func:Callable[[int,int],Image], r:int=1, c:int=1, figsize... function show_all (line 623) | def show_all(imgs:Collection[Image], r:int=1, c:Optional[int]=None, figs... FILE: fastai/vision/interpret.py class SegmentationInterpretation (line 10) | class SegmentationInterpretation(Interpretation): method __init__ (line 12) | def __init__(self, learn:Learner, preds:Tensor, y_true:Tensor, losses:... method top_losses (line 19) | def top_losses(self, sizes:Tuple, k:int=None, largest=True): method _interp_show (line 24) | def _interp_show(self, ims:ImageSegment, classes:Collection=None, sz:i... method show_xyz (line 53) | def show_xyz(self, i, classes:list=None, sz=10): method _generate_confusion (line 60) | def _generate_confusion(self): method _plot_intersect_cm (line 79) | def _plot_intersect_cm(self, cm, title="Intersection with Predict give... class ObjectDetectionInterpretation (line 101) | class ObjectDetectionInterpretation(Interpretation): method __init__ (line 103) | def __init__(self, learn:Learner, preds:Tensor, y_true:Tensor, losses:... FILE: fastai/vision/learner.py function _default_split (line 14) | def _default_split(m:nn.Module): return (m[1],) function _resnet_split (line 16) | def _resnet_split(m:nn.Module): return (m[0][6],m[1]) function _squeezenet_split (line 18) | def _squeezenet_split(m:nn.Module): return (m[0][0][5], m[0][0][8], m[1]) function _densenet_split (line 19) | def _densenet_split(m:nn.Module): return (m[0][0][7],m[1]) function _vgg_split (line 20) | def _vgg_split(m:nn.Module): return (m[0][0][22],m[1]) function _alexnet_split (line 21) | def _alexnet_split(m:nn.Module): return (m[0][0][6],m[1]) function cnn_config (line 43) | def cnn_config(arch): function has_pool_type (line 48) | def has_pool_type(m): function create_body (line 54) | def create_body(arch:Callable, pretrained:bool=True, cut:Optional[Union[... function create_head (line 66) | def create_head(nf:int, nc:int, lin_ftrs:Optional[Collection[int]]=None,... function create_cnn_model (line 80) | def create_cnn_model(base_arch:Callable, nc:int, cut:Union[int,Callable]... function cnn_learner (line 91) | def cnn_learner(data:DataBunch, base_arch:Callable, cut:Union[int,Callab... function create_cnn (line 105) | def create_cnn(data, base_arch, **kwargs): function unet_learner (line 109) | def unet_learner(data:DataBunch, arch:Callable, pretrained:bool=True, bl... function _cl_int_from_learner (line 128) | def _cl_int_from_learner(cls, learn:Learner, ds_type:DatasetType=Dataset... function _test_cnn (line 134) | def _test_cnn(m): function _cl_int_gradcam (line 138) | def _cl_int_gradcam(self, idx, heatmap_thresh:int=16, image:bool=True): function _cl_int_plot_top_losses (line 163) | def _cl_int_plot_top_losses(self, k, largest=True, figsize=(12,12), heat... function _cl_int_plot_multi_top_losses (line 186) | def _cl_int_plot_multi_top_losses(self, samples:int=3, figsize:Tuple[int... function _learner_interpret (line 233) | def _learner_interpret(learn:Learner, ds_type:DatasetType=DatasetType.Va... FILE: fastai/vision/models/cadene_models.py function get_model (line 14) | def get_model(model_name:str, pretrained:bool, seq:bool=False, pname:str... function inceptionv4 (line 19) | def inceptionv4(pretrained:bool=False): function nasnetamobile (line 25) | def nasnetamobile(pretrained:bool=False): function pnasnet5large (line 31) | def pnasnet5large(pretrained:bool=False): function inceptionresnetv2 (line 37) | def inceptionresnetv2(pretrained:bool=False): return get_model('incept... function dpn92 (line 38) | def dpn92(pretrained:bool=False): return get_model('dpn92'... function xception_cadene (line 39) | def xception_cadene(pretrained=False): return get_model('xcepti... function se_resnet50 (line 40) | def se_resnet50(pretrained:bool=False): return get_model('se_res... function se_resnet101 (line 41) | def se_resnet101(pretrained:bool=False): return get_model('se_res... function se_resnext50_32x4d (line 42) | def se_resnext50_32x4d(pretrained:bool=False): return get_model('se_res... function se_resnext101_32x4d (line 43) | def se_resnext101_32x4d(pretrained:bool=False): return get_model('se_res... function senet154 (line 44) | def senet154(pretrained:bool=False): return get_model('senet1... FILE: fastai/vision/models/darknet.py function conv_bn_lrelu (line 6) | def conv_bn_lrelu(ni:int, nf:int, ks:int=3, stride:int=1)->nn.Sequential: class ResLayer (line 13) | class ResLayer(Module): method __init__ (line 15) | def __init__(self, ni:int): method forward (line 19) | def forward(self, x): return x + self.conv2(self.conv1(x)) class Darknet (line 21) | class Darknet(Module): method make_group_layer (line 23) | def make_group_layer(self, ch_in:int, num_blocks:int, stride:int=1): method __init__ (line 28) | def __init__(self, num_blocks:Collection[int], num_classes:int, nf=32): method forward (line 37) | def forward(self, x): return self.layers(x) FILE: fastai/vision/models/presnet.py function init_cnn (line 12) | def init_cnn(m): function conv (line 18) | def conv(ni, nf, ks=3, stride=1, bias=False): function conv_layer (line 21) | def conv_layer(conv_1st, ni, nf, ks=3, stride=1, zero_bn=False, bias=Fal... function conv_act (line 29) | def conv_act(*args, **kwargs): return conv_layer(True , *args, **kwargs) function act_conv (line 30) | def act_conv(*args, **kwargs): return conv_layer(False, *args, **kwargs) class BasicBlock (line 32) | class BasicBlock(Module): method __init__ (line 35) | def __init__(self, ni, nf, stride=1, downsample=None): method forward (line 42) | def forward(self, x): class Bottleneck (line 49) | class Bottleneck(Module): method __init__ (line 52) | def __init__(self, ni, nf, stride=1, downsample=None): method forward (line 60) | def forward(self, x): class PResNet (line 68) | class PResNet(Module): method __init__ (line 70) | def __init__(self, block, layers, num_classes=1000): method _make_layer (line 88) | def _make_layer(self, block, nf, blocks, stride=1): method forward (line 101) | def forward(self, x): function presnet (line 120) | def presnet(block, n_layers, name, pre=False, **kwargs): function presnet18 (line 126) | def presnet18(pretrained=False, **kwargs): function presnet34 (line 129) | def presnet34(pretrained=False, **kwargs): function presnet50 (line 132) | def presnet50(pretrained=False, **kwargs): function presnet101 (line 135) | def presnet101(pretrained=False, **kwargs): function presnet152 (line 138) | def presnet152(pretrained=False, **kwargs): FILE: fastai/vision/models/unet.py function _get_sfs_idxs (line 7) | def _get_sfs_idxs(sizes:Sizes) -> List[int]: class UnetBlock (line 14) | class UnetBlock(Module): method __init__ (line 16) | def __init__(self, up_in_c:int, x_in_c:int, hook:Hook, final_div:bool=... method forward (line 27) | def forward(self, up_in:Tensor) -> Tensor: class DynamicUnet (line 37) | class DynamicUnet(SequentialEx): method __init__ (line 39) | def __init__(self, encoder:nn.Module, n_classes:int, img_size:Tuple[in... method __del__ (line 76) | def __del__(self): FILE: fastai/vision/models/wrn.py function _bn (line 6) | def _bn(ni, init_zero=False): function bn_relu_conv (line 13) | def bn_relu_conv(ni, nf, ks, stride, init_zero=False): class BasicBlock (line 17) | class BasicBlock(Module): method __init__ (line 19) | def __init__(self, ni, nf, stride, drop_p=0.0): method forward (line 26) | def forward(self, x): function _make_group (line 34) | def _make_group(N, ni, nf, block, stride, drop_p): class WideResNet (line 37) | class WideResNet(Module): method __init__ (line 39) | def __init__(self, num_groups:int, N:int, num_classes:int, k:int=1, dr... method forward (line 51) | def forward(self, x): return self.features(x) function wrn_22 (line 54) | def wrn_22(): FILE: fastai/vision/models/xception.py function sep_conv (line 5) | def sep_conv(ni,nf,pad=None,pool=False,act=True): function conv (line 15) | def conv(ni,nf,ks=1,stride=1, pad=None, act=True): class ConvSkip (line 24) | class ConvSkip(Module): method __init__ (line 25) | def __init__(self,ni,nf=None,act=True): method forward (line 34) | def forward(self,x): return self.conv(x) + self.m(x) function middle_flow (line 36) | def middle_flow(nf): function xception (line 40) | def xception(c, k=8, n_middle=8): FILE: fastai/vision/models/xresnet.py class Flatten (line 12) | class Flatten(Module): method forward (line 13) | def forward(self, x): return x.view(x.size(0), -1) function init_cnn (line 15) | def init_cnn(m): function conv (line 20) | def conv(ni, nf, ks=3, stride=1, bias=False): function noop (line 23) | def noop(x): return x function conv_layer (line 25) | def conv_layer(ni, nf, ks=3, stride=1, zero_bn=False, act=True): class ResBlock (line 32) | class ResBlock(Module): method __init__ (line 33) | def __init__(self, expansion, ni, nh, stride=1): method forward (line 47) | def forward(self, x): return act_fn(self.convs(x) + self.idconv(self.p... function filt_sz (line 49) | def filt_sz(recep): return min(64, 2**math.floor(math.log2(recep*0.75))) class XResNet (line 51) | class XResNet(nn.Sequential): method __init__ (line 52) | def __init__(self, expansion, layers, c_in=3, c_out=1000): method _make_layer (line 73) | def _make_layer(self, expansion, ni, nf, blocks, stride): function xresnet (line 78) | def xresnet(expansion, n_layers, name, pretrained=False, **kwargs): FILE: fastai/vision/models/xresnet2.py function conv3x3 (line 11) | def conv3x3(in_planes, out_planes, stride=1): class BasicBlock (line 15) | class BasicBlock(Module): method __init__ (line 18) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 28) | def forward(self, x): class Bottleneck (line 46) | class Bottleneck(Module): method __init__ (line 49) | def __init__(self, inplanes, planes, stride=1, downsample=None): method forward (line 62) | def forward(self, x): function conv2d (line 83) | def conv2d(ni, nf, stride): class XResNet (line 87) | class XResNet(Module): method __init__ (line 89) | def __init__(self, block, layers, c_out=1000): method _make_layer (line 115) | def _make_layer(self, block, planes, blocks, stride=1): method forward (line 131) | def forward(self, x): function xresnet18 (line 149) | def xresnet18(pretrained=False, **kwargs): function xresnet34_2 (line 160) | def xresnet34_2(pretrained=False, **kwargs): function xresnet50_2 (line 171) | def xresnet50_2(pretrained=False, **kwargs): function xresnet101 (line 182) | def xresnet101(pretrained=False, **kwargs): function xresnet152 (line 193) | def xresnet152(pretrained=False, **kwargs): FILE: fastai/vision/transform.py function _brightness (line 15) | def _brightness(x, change:uniform): function _contrast (line 20) | def _contrast(x, scale:log_uniform): function _rotate (line 25) | def _rotate(degrees:uniform): function _get_zoom_mat (line 33) | def _get_zoom_mat(sw:float, sh:float, c:float, r:float)->AffineMatrix: function _zoom (line 39) | def _zoom(scale:uniform=1.0, row_pct:uniform=0.5, col_pct:uniform=0.5): function _squish (line 47) | def _squish(scale:uniform=1.0, row_pct:uniform=0.5, col_pct:uniform=0.5): function _jitter (line 57) | def _jitter(c, magnitude:uniform): function _flip_lr (line 63) | def _flip_lr(x): function _flip_affine (line 72) | def _flip_affine() -> TfmAffine: function _dihedral (line 79) | def _dihedral(x, k:partial(uniform_int,0,7)): function _dihedral_affine (line 89) | def _dihedral_affine(k:partial(uniform_int,0,7)): function _pad_coord (line 101) | def _pad_coord(x, row_pad:int, col_pad:int, mode='zeros'): function _pad_default (line 108) | def _pad_default(x, padding:int, mode='reflection'): function _pad_image_points (line 113) | def _pad_image_points(x, padding:int, mode='reflection'): function _pad (line 116) | def _pad(x, padding:int, mode='reflection'): function _cutout (line 122) | def _cutout(x, n_holes:uniform_int=1, length:uniform_int=40): function _rgb_randomize (line 137) | def _rgb_randomize(x, channel:int=None, thresh:float=0.3): function _minus_epsilon (line 145) | def _minus_epsilon(row_pct:float, col_pct:float, eps:float=1e-7): function _crop_default (line 150) | def _crop_default(x, size, row_pct:uniform=0.5, col_pct:uniform=0.5): function _crop_image_points (line 158) | def _crop_image_points(x, size, row_pct=0.5, col_pct=0.5): function _crop (line 169) | def _crop(x, size, row_pct:uniform=0.5, col_pct:uniform=0.5): function _crop_pad_default (line 175) | def _crop_pad_default(x, size, padding_mode='reflection', row_pct:unifor... function _crop_pad_image_points (line 191) | def _crop_pad_image_points(x, size, padding_mode='reflection', row_pct =... function _crop_pad (line 200) | def _crop_pad(x, size, padding_mode='reflection', row_pct:uniform = 0.5,... function _image_maybe_add_crop_pad (line 206) | def _image_maybe_add_crop_pad(img, tfms): function rand_pad (line 213) | def rand_pad(padding:int, size:int, mode:str='reflection'): function rand_zoom (line 218) | def rand_zoom(scale:uniform=1.0, p:float=1.): function rand_crop (line 222) | def rand_crop(*args, padding_mode='reflection', p:float=1.): function zoom_crop (line 226) | def zoom_crop(scale:float, do_rand:bool=False, p:float=1.0): function _find_coeffs (line 232) | def _find_coeffs(orig_pts:Points, targ_pts:Points)->Tensor: function _apply_perspective (line 245) | def _apply_perspective(coords:FlowField, coeffs:Points)->FlowField: function _do_perspective_warp (line 259) | def _do_perspective_warp(c:FlowField, targ_pts:Points, invert=False): function _perspective_warp (line 264) | def _perspective_warp(c, magnitude:partial(uniform,size=8)=0, invert=Fal... function _symmetric_warp (line 271) | def _symmetric_warp(c, magnitude:partial(uniform,size=4)=0, invert=False): function _tilt (line 278) | def _tilt(c, direction:uniform_int, magnitude:uniform=0, invert=False): function _skew (line 289) | def _skew(c, direction:uniform_int, magnitude:uniform=0, invert=False): function get_transforms (line 304) | def get_transforms(do_flip:bool=True, flip_vert:bool=False, max_rotate:f... function _compute_zs_mat (line 319) | def _compute_zs_mat(sz:TensorImageSize, scale:float, squish:float, function _zoom_squish (line 335) | def _zoom_squish(c, scale:uniform=1.0, squish:uniform=1.0, invert:rand_b... function rand_resize_crop (line 343) | def rand_resize_crop(size:int, max_scale:float=2., ratios:Tuple[float,fl... FILE: fastai/vision/tta.py function _tta_only (line 10) | def _tta_only(learn:Learner, ds_type:DatasetType=DatasetType.Valid, acti... function _TTA (line 33) | def _TTA(learn:Learner, beta:float=0.4, scale:float=1.35, ds_type:Datase... FILE: fastai/widgets/class_confusion.py class ClassConfusion (line 10) | class ClassConfusion(): method __init__ (line 12) | def __init__(self, interp:ClassificationInterpretation, classlist:list, method _show_losses (line 30) | def _show_losses(self, classl:list, **kwargs): method _create_tabs (line 35) | def _create_tabs(self): method _populate_tabs (line 60) | def _populate_tabs(self): method _plot_tab (line 69) | def _plot_tab(self, tab:str): method _plot_imgs (line 107) | def _plot_imgs(self, tab:str, i:int ,**kwargs): method _tab_losses (line 138) | def _tab_losses(self, **kwargs): FILE: fastai/widgets/image_cleaner.py class DatasetFormatter (line 14) | class DatasetFormatter(): method from_toplosses (line 17) | def from_toplosses(cls, learn, n_imgs=None, **kwargs): method get_toplosses_idxs (line 23) | def get_toplosses_idxs(cls, learn, n_imgs, **kwargs): method padded_ds (line 31) | def padded_ds(ll_input, size=(250, 300), resize_method=ResizeMethod.CR... method from_similars (line 36) | def from_similars(cls, learn, layer_ls:list=[0, 7, 2], **kwargs): method get_similars_idxs (line 42) | def get_similars_idxs(cls, learn, layer_ls, **kwargs): method get_actns (line 53) | def get_actns(learn, hook:Hook, dl:DataLoader, pool=AdaptiveConcatPool... method comb_similarity (line 71) | def comb_similarity(t1: torch.Tensor, t2: torch.Tensor, **kwargs): method largest_indices (line 82) | def largest_indices(arr, n): method sort_idxs (line 91) | def sort_idxs(cls, similarities): class ImageCleaner (line 97) | class ImageCleaner(): method __init__ (line 99) | def __init__(self, dataset, fns_idxs, path, batch_size:int=5, duplicat... method make_img_widget (line 113) | def make_img_widget(cls, img, layout=Layout(), format='jpg'): method make_button_widget (line 118) | def make_button_widget(cls, label, file_path=None, handler=None, style... method make_dropdown_widget (line 128) | def make_dropdown_widget(cls, description='Description', options=['Lab... method make_horizontal_box (line 137) | def make_horizontal_box(cls, children, layout=Layout()): method make_vertical_box (line 142) | def make_vertical_box(cls, children, layout=Layout(), duplicates=False): method create_image_list (line 147) | def create_image_list(self, dataset, fns_idxs): method relabel (line 158) | def relabel(self, change): method next_batch (line 165) | def next_batch(self, _): method on_delete (line 176) | def on_delete(self, btn): method empty_batch (line 181) | def empty_batch(self): self._batch[:] = [] method delete_image (line 183) | def delete_image(self, file_path): method empty (line 186) | def empty(self): method get_widgets (line 189) | def get_widgets(self, duplicates): method batch_contains_deleted (line 203) | def batch_contains_deleted(self): method write_csv (line 209) | def write_csv(self): method render (line 220) | def render(self): FILE: fastai/widgets/image_downloader.py class ImageDownloader (line 16) | class ImageDownloader(): method __init__ (line 21) | def __init__(self, path:Union[Path,str]='data'): method _init_ui (line 27) | def _init_ui(self) -> VBox: method render (line 44) | def render(self) -> None: method clear_imgs (line 48) | def clear_imgs(self) -> None: method validate_search_input (line 53) | def validate_search_input(self) -> bool: method on_download_button_click (line 60) | def on_download_button_click(self, btn) -> None: method display_images_widgets (line 72) | def display_images_widgets(self, fnames:list) -> None: function download_google_images (line 78) | def download_google_images(path:PathOrStr, search_term:str, size:str='>4... function _url_params (line 93) | def _url_params(size:str='>400*300', format:str='jpg') -> str: function _search_url (line 103) | def _search_url(search_term:str, size:str='>400*300', format:str='jpg') ... function _img_fname (line 109) | def _img_fname(img_url:str) -> str: function _fetch_img_tuples (line 113) | def _fetch_img_tuples(url:str, format:str='jpg', n_images:int=10) -> list: function _html_to_img_tuples (line 119) | def _html_to_img_tuples(html:str, format:str='jpg', n_images:int=10) -> ... function _fetch_img_tuples_webdriver (line 127) | def _fetch_img_tuples_webdriver(url:str, format:str='jpg', n_images:int=... function _download_images (line 159) | def _download_images(label_path:PathOrStr, img_tuples:list, max_workers:... function _download_single_image (line 170) | def _download_single_image(label_path:Path, img_tuple:tuple, i:int, time... FILE: fid/fid_score.py function tqdm (line 54) | def tqdm(x): function load_image_resized (line 83) | def load_image_resized(fn, sz): function get_activations (line 89) | def get_activations( function calculate_frechet_distance (line 175) | def calculate_frechet_distance(mu1, sigma1, mu2, sigma2, eps=1e-6): function calculate_activation_statistics (line 235) | def calculate_activation_statistics( function _compute_statistics_of_path (line 261) | def _compute_statistics_of_path(path, model, batch_size, dims, cuda): function calculate_fid_given_paths (line 274) | def calculate_fid_given_paths(paths, batch_size, cuda, dims): FILE: fid/inception.py class InceptionV3 (line 16) | class InceptionV3(nn.Module): method __init__ (line 31) | def __init__( method forward (line 130) | def forward(self, inp): function fid_inception_v3 (line 164) | def fid_inception_v3(): class FIDInceptionA (line 191) | class FIDInceptionA(models.inception.InceptionA): method __init__ (line 194) | def __init__(self, in_channels, pool_features): method forward (line 197) | def forward(self, x): class FIDInceptionC (line 218) | class FIDInceptionC(models.inception.InceptionC): method __init__ (line 221) | def __init__(self, in_channels, channels_7x7): method forward (line 224) | def forward(self, x): class FIDInceptionE_1 (line 248) | class FIDInceptionE_1(models.inception.InceptionE): method __init__ (line 251) | def __init__(self, in_channels): method forward (line 254) | def forward(self, x): class FIDInceptionE_2 (line 283) | class FIDInceptionE_2(models.inception.InceptionE): method __init__ (line 286) | def __init__(self, in_channels): method forward (line 289) | def forward(self, x): FILE: setup.py function get_description (line 4) | def get_description(): function get_requirements (line 13) | def get_requirements():