optimizer = {
    "adam": "torch.optim.Adam",
    "adamw": "torch.optim.AdamW",
    "rmsprop": "torch.optim.RMSprop",
    "sgd": "torch.optim.SGD",
    "lamb": "src.utils.optim.lamb.JITLamb",
}

scheduler = {
    "constant": "transformers.get_constant_schedule",
    "plateau": "torch.optim.lr_scheduler.ReduceLROnPlateau",
    "step": "torch.optim.lr_scheduler.StepLR",
    "multistep": "torch.optim.lr_scheduler.MultiStepLR",
    "cosine": "torch.optim.lr_scheduler.CosineAnnealingLR",
    "constant_warmup": "transformers.get_constant_schedule_with_warmup",
    "linear_warmup": "transformers.get_linear_schedule_with_warmup",
    "cosine_warmup": "transformers.get_cosine_schedule_with_warmup",
    "cosine_warmup_timm": "src.utils.optim.schedulers.TimmCosineLRScheduler",
}

model = {
    # Backbones from this repo
    "model": "src.models.sequence.SequenceModel",
    "lm": "src.models.sequence.long_conv_lm.ConvLMHeadModel",
    "lm_simple": "src.models.sequence.simple_lm.SimpleLMHeadModel",
    "vit_b_16": "src.models.baselines.vit_all.vit_base_patch16_224",
}

layer = {
    "id": "src.models.sequence.base.SequenceIdentity",
    "ff": "src.models.sequence.ff.FF",
    "id_lookback": "src.models.sequence.id_lookback.FF_lookback",
    "encmlp": "src.models.nn.mlp.CustomHyenaMLP",
    "mha": "src.models.sequence.mha.MultiheadAttention",
    "s4d": "src.models.sequence.ssm.s4d.S4D",
    "s4_simple": "src.models.sequence.ssm.s4_simple.SimpleS4Wrapper",
    "long-conv": "src.models.sequence.long_conv.LongConv",
    "attention_factors": "src.models.sequence.attention_factors.AttentionFactors",
    "h3": "src.models.sequence.h3.H3",
    "h3-conv": "src.models.sequence.h3_conv.H3Conv",
    "hyena": "src.models.sequence.hyena.HyenaOperator",
    "laughing-hyena": "src.models.sequence.laughing_hyena.LaughingHyenaOperator",
    "laughing-hyena-filter": "src.models.sequence.laughing_hyena.LaughingHyenaFilter",
    "hedgehog": "src.models.sequence.hedgehog.HedgehogBlock",
    "multihyena": "src.models.sequence.hyena.MultiHeadHyenaOperator",
    "hyena-exp": "src.models.sequence.experimental_hyena.CheckpointedHyenaOperator",
    "hyena-filter": "src.models.sequence.hyena.HyenaFilter",
    "monarch-filter": "src.models.sequence.monarch_conv.MonarchFilter",
    "vit": "src.models.sequence.mha.VitAttention",
    "cross-former": "src.models.sequence.crossformer.Crossformer",
}

callbacks = {
    "timer": "src.callbacks.timer.Timer",
    "params": "src.callbacks.params.ParamsLog",
    "learning_rate_monitor": "pytorch_lightning.callbacks.LearningRateMonitor",
    "model_checkpoint": "pytorch_lightning.callbacks.ModelCheckpoint",
    "early_stopping": "pytorch_lightning.callbacks.EarlyStopping",
    "swa": "pytorch_lightning.callbacks.StochasticWeightAveraging",
    "rich_model_summary": "pytorch_lightning.callbacks.RichModelSummary",
    "rich_progress_bar": "pytorch_lightning.callbacks.RichProgressBar",
    "progressive_resizing": "src.callbacks.progressive_resizing.ProgressiveResizing",
    "norm_monitor": "src.callbacks.norm_monitor.NormMonitor",
    "track_norms": "src.callbacks.norms.TrackNorms",
}

# [MP] Pipelines to postprocess or finetune a model
postprocess_methods = {"distill-conv": "src.utils.postprocess.ConvDistiller"}
