def _engines_loader(r: hydra_slayer.Registry): from catalyst.core.engine import IEngine r.add(IEngine) from catalyst import engines as m r.add_from_module(m)
def _samplers_loader(r: hydra_slayer.Registry): from torch.utils.data import sampler as s factories = {k: v for k, v in s.__dict__.items() if "Sampler" in k and k != "Sampler"} r.add(**factories) from catalyst.data import sampler r.add_from_module(sampler)
def _datasets_loader(r: hydra_slayer.Registry): from catalyst.data import dataset as m r.add_from_module(m) from catalyst.contrib import datasets as m_contrib r.add_from_module(m_contrib)
def _optimizers_loader(r: hydra_slayer.Registry): from catalyst.contrib.nn import optimizers as m r.add_from_module(m) if SETTINGS.fairscale_required: from fairscale import optim as m2 r.add_from_module(m2, prefix=["fairscale."])
def _runners_loader(r: hydra_slayer.Registry): from catalyst.core.runner import IRunner r.add(IRunner) r.add(IRunner) from catalyst import runners as m r.add_from_module(m)
def _callbacks_loader(r: hydra_slayer.Registry): from catalyst.core.callback import Callback, CallbackWrapper r.add(Callback) r.add(CallbackWrapper) from catalyst import callbacks as m r.add_from_module(m)
def _transforms_loader(r: hydra_slayer.Registry): from catalyst.data import transforms as t # add `'transform.'` prefix to avoid nameing conflicts with other catalyst modules r.add_from_module(t, prefix=["transform."]) if SETTINGS.albu_required: import albumentations as m r.add_from_module(m, prefix=["A.", "albu.", "albumentations."]) from albumentations import pytorch as p r.add_from_module(p, prefix=["A.", "albu.", "albumentations."])
def _criterion_loader(r: hydra_slayer.Registry): from catalyst.contrib.nn import criterion as m r.add_from_module(m)
def _model_loader(r: hydra_slayer.Registry): from catalyst.contrib import models as m r.add_from_module(m)
def _grad_clip_loader(r: hydra_slayer.Registry): from torch.nn.utils import clip_grad as m r.add_from_module(m)
def _dataloaders_loader(r: hydra_slayer.Registry): from torch.utils.data import DataLoader r.add(DataLoader)
def _torch_loader(r: hydra_slayer.Registry): import torch as m r.add_from_module(m, ["torch."], ignore_all=True)
def _torch_functional_loader(r: hydra_slayer.Registry): import torch.nn.functional as F r.add_from_module(F, ["F."])
def _loggers_loader(r: hydra_slayer.Registry): from catalyst import loggers as m r.add_from_module(m)
def _schedulers_loader(r: hydra_slayer.Registry): from catalyst.contrib.nn import schedulers as m r.add_from_module(m)