Skip to content

Commit

Permalink
Merge typing implementations, sort.
Browse files Browse the repository at this point in the history
Signed-off-by: Emanuele Ballarin <[email protected]>
  • Loading branch information
emaballarin committed Dec 11, 2024
1 parent 9c5fcd4 commit 1f6df47
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 102 deletions.
68 changes: 35 additions & 33 deletions ebtorch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
del data_prep_dispatcher_3ch
del fashionmnist_dataloader_dispatcher
del imagenette_dataloader_dispatcher
del mnist_dataloader_dispatcher
del kmnist_dataloader_dispatcher
del pathmnist_dataloader_dispatcher
del mnist_dataloader_dispatcher
del octmnist_dataloader_dispatcher
del tissuemnist_dataloader_dispatcher
del pathmnist_dataloader_dispatcher
del tinyimagenet_dataloader_dispatcher
del tissuemnist_dataloader_dispatcher

# Deletions (from .distributed)
del reduce_accumulate_keepalive
Expand All @@ -53,29 +53,31 @@
del ArgMaxLayer
del BasicAE
del BasicVAE
del SingleNeckVAE
del beta_gaussian_kldiv
del var_of_lap
del BinarizeLayer
del BrokenReLU
del CausalConv1d
del Clamp
del Concatenate
del ConvNeXtStem
del ConvStem
del ConvolutionalFlattenLayer
del CoordConv1d
del CoordConv2d
del CoordConv3d
del DeepRBL
del DuplexLinearNeck
del FCBlock
del FieldTransform
del FlatChannelize2DLayer
del GRNorm
del GaussianReparameterizerSampler
del GaussianReparameterizerSamplerLegacy
del GenerAct
del InnerProduct
del KWTA1d
del KWTA2d
del MetaAILayerNorm
del Mish
del multilasso
del multiridge
del MultiSolvePoissonTensor
del NNEnsemble
del PoissonNetCifar
Expand All @@ -87,47 +89,46 @@
del SERLU
del SGRUHCell
del ScaledERF
del SharedDuplexLinearNeck
del SilhouetteScore
del SimpleDuplexLinearNeck
del SinLU
del SingleNeckVAE
del SirenSine
del SmeLU
del SolvePoisson
del SolvePoissonTensor
del StatefulTupleSelect
del SwiGLU
del TupleDecouple
del TupleSelect
del StatefulTupleSelect
del SilhouetteScore
del Concatenate
del DuplexLinearNeck
del SharedDuplexLinearNeck
del SimpleDuplexLinearNeck
del GenerAct
del ViTStem
del WideResNet
del beta_gaussian_kldiv
del beta_reco_bce
del beta_reco_bce_splitout
del lexsemble
del beta_reco_mse
del beta_reco_mse_splitout
del bisided_thresholding
del build_repeated_sequential
del cummatmul
del field_transform
del lexsemble
del logit_to_prob
del mishlayer_init
del multilasso
del multiridge
del oldtranspose
del pixelwise_bce_mean
del pixelwise_bce_sum
del pixelwise_mse_sum
del pixelwise_mse_mean
del beta_reco_mse
del beta_reco_mse_splitout
del oldtranspose
del pixelwise_mse_sum
del silhouette_score
del cummatmul
del tensor_replicate
del logit_to_prob
del bisided_thresholding
del ConvNeXtStem
del ConvStem
del GRNorm
del MetaAILayerNorm
del ViTStem
del var_of_lap

# Deletions (from .optim)
del ADOPT
del AdaBound
del AdamP
del Adan
Expand All @@ -137,19 +138,18 @@
del Lookahead
del Lookaround
del RAdam
del ADOPT
del SAM
del SGDP
del alah_optim
del epochwise_onecycle
del make_beta_scheduler
del onecycle_lincos
del onecycle_linlin
del onecycle_linlin_updown
del warmed_up_linneal
del warmed_up_annealer
del make_beta_scheduler
del alah_optim
del ralah_optim
del tricyc1c
del warmed_up_annealer
del warmed_up_linneal
del wfneal

# Deletions (from .logging)
Expand All @@ -159,4 +159,6 @@
# Deletions (from .typing)
del numlike
del realnum
del realnum
del strdev
del tensorlike
1 change: 0 additions & 1 deletion ebtorch/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@
del cutmixup
del datasets
del prep
del tinyimagenet
2 changes: 1 addition & 1 deletion ebtorch/distributed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
from .slurm import slurm_nccl_env

# ──────────────────────────────────────────────────────────────────────────────
del slurm
del qol
del slurm
58 changes: 27 additions & 31 deletions ebtorch/nn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@
del nnsemble
del penalties
del reshapelayers
del serf
del serlu
del sinlu
del smelu
del serf

# Deletions (from .functional)
# del mish # (already done by chance!)
Expand All @@ -118,49 +118,45 @@
del AdverApply
del AutoClipper
del TA2ATAdapter
del eval_model_on_test
del extract_conv_filters
del argser_f
del find_lr
del fxfx2module
del act_opclone
del suppress_std
del TelegramBotEcho
del stablediv
del act_auto_broadcast
del act_opclone
del argser_f
del argsink
del no_op
del broadcast_in_dim
del custom_plot_setup
del download_gdrive
del emplace_kv
del show_filters
del subset_state_dict
del eval_model_on_test
del extract_conv_filters
del find_lr
del fromcache
del fxfx2module
del gather_model_repr
del matched_apply
del model_reqgrad
del model_reqgrad_
del no_op
del patchify_2d
del patchify_batch
del patchify_dataset
del petroff_2021_cmap
del petroff_2021_color
del petroff_2021_cycler
del plot_out
del repr_fx_flat_adapter
del repr_sizes_flat_adapter
del set_petroff_2021_colors
del set_tableau10_colors
del show_filters
del stablediv
del store_repr_autohook
del store_repr_fx
del store_repr_hook
del petroff_2021_color
del subset_state_dict
del suppress_std
del tableau10_cmap
del tableau10_color
del petroff_2021_cycler
del tableau10_cycler
del petroff_2021_cmap
del tableau10_cmap
del variadic_attrs
del set_petroff_2021_colors
del set_tableau10_colors
del custom_plot_setup
del plot_out
del fromcache
del repr_sizes_flat_adapter
del repr_fx_flat_adapter
del act_auto_broadcast
del broadcast_in_dim
del matched_apply
del tensor_module_matched_apply
del realnum
del strdev
del actvt
del numlike
del variadic_attrs
19 changes: 7 additions & 12 deletions ebtorch/nn/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
from .attrsutils import variadic_attrs
from .autoclip import AutoClipper
from .cacher import fromcache
from .csttyping import actvt
from .csttyping import numlike
from .csttyping import realnum
from .csttyping import strdev
from .evalutils import eval_model_on_test
from .filtermanip import extract_conv_filters
from .filtermanip import show_filters
Expand Down Expand Up @@ -63,18 +59,17 @@
from .reprutils import store_repr_hook

# Deletions (from .)
del adverutils
del actab
del adverutils
del attrsutils
del autoclip
del cacher
del evalutils
del filtermanip
del lrfinder
del mapply
del onlyutils
del patches
del reprutils
del filtermanip
del palettes
del cacher
del patches
del plotting
del attrsutils
del mapply
del csttyping
del reprutils
19 changes: 0 additions & 19 deletions ebtorch/nn/utils/csttyping.py

This file was deleted.

4 changes: 2 additions & 2 deletions ebtorch/nn/utils/onlyutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
from torch import nn
from torch import Tensor

from .csttyping import actvt
from .csttyping import numlike
from ...typing import actvt
from ...typing import numlike

__all__ = [
"argser_f",
Expand Down
2 changes: 1 addition & 1 deletion ebtorch/optim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
# Deletions (from .)
del adabound
del adan
del adopt
del custom
del lamb
del lion
del lookahead
del lookaround
del poptims
del radam
del adopt
del sam
del schedcos
2 changes: 2 additions & 0 deletions ebtorch/typing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
#
# ──────────────────────────────────────────────────────────────────────────────
# Imports
from .customtypes import actvt
from .customtypes import numlike
from .customtypes import realnum
from .customtypes import strdev
from .customtypes import tensorlike

# Deletions (from .)
del customtypes
4 changes: 3 additions & 1 deletion ebtorch/typing/customtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
# ──────────────────────────────────────────────────────────────────────────────
# Imports
from collections.abc import Callable
from typing import List
from typing import Union

Expand All @@ -10,10 +11,11 @@
from torch import Tensor

# ──────────────────────────────────────────────────────────────────────────────
__all__: List[str] = ["realnum", "strdev", "numlike", "tensorlike"]
__all__: List[str] = ["realnum", "strdev", "numlike", "tensorlike", "actvt"]
# ──────────────────────────────────────────────────────────────────────────────
realnum = Union[int, float]
strdev = Union[str, torch.device]
tensorlike = Union[Tensor, np.ndarray]
numlike = Union[realnum, tensorlike]
actvt = Union[torch.nn.Module, Callable[[Tensor], Tensor]]
# ──────────────────────────────────────────────────────────────────────────────
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def read(fname):

setup(
name=PACKAGENAME,
version="0.28.3",
version="0.28.4",
author="Emanuele Ballarin",
author_email="[email protected]",
url="https://github.com/emaballarin/ebtorch",
Expand Down

0 comments on commit 1f6df47

Please sign in to comment.