nshtrainer 0.6.2__py3-none-any.whl → 0.8.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nshtrainer/__init__.py +0 -2
- nshtrainer/ll/__init__.py +57 -45
- nshtrainer/ll/actsave.py +3 -0
- nshtrainer/ll/callbacks.py +1 -0
- nshtrainer/ll/config.py +4 -0
- nshtrainer/ll/data.py +1 -0
- nshtrainer/ll/log.py +3 -0
- nshtrainer/ll/lr_scheduler.py +1 -0
- nshtrainer/ll/model.py +1 -0
- nshtrainer/ll/nn.py +1 -0
- nshtrainer/ll/optimizer.py +1 -0
- nshtrainer/ll/runner.py +3 -0
- nshtrainer/ll/snoop.py +1 -0
- nshtrainer/ll/trainer.py +1 -0
- nshtrainer/ll/util.py +1 -0
- nshtrainer/lr_scheduler/reduce_lr_on_plateau.py +1 -1
- nshtrainer/model/base.py +1 -1
- {nshtrainer-0.6.2.dist-info → nshtrainer-0.8.1.dist-info}/METADATA +4 -7
- {nshtrainer-0.6.2.dist-info → nshtrainer-0.8.1.dist-info}/RECORD +21 -10
- nshtrainer/_snoop.py +0 -1
- nshtrainer/config.py +0 -4
- /nshtrainer/{typecheck.py → ll/typecheck.py} +0 -0
- {nshtrainer-0.6.2.dist-info → nshtrainer-0.8.1.dist-info}/WHEEL +0 -0
nshtrainer/__init__.py
CHANGED
|
@@ -6,8 +6,6 @@ from . import lr_scheduler as lr_scheduler
|
|
|
6
6
|
from . import model as model
|
|
7
7
|
from . import nn as nn
|
|
8
8
|
from . import optimizer as optimizer
|
|
9
|
-
from . import typecheck as typecheck
|
|
10
|
-
from ._snoop import snoop as snoop
|
|
11
9
|
from .actsave import ActLoad as ActLoad
|
|
12
10
|
from .actsave import ActSave as ActSave
|
|
13
11
|
from .data import dataset_transform as dataset_transform
|
nshtrainer/ll/__init__.py
CHANGED
|
@@ -1,46 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
from
|
|
4
|
-
from
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
# Handle submodule imports
|
|
35
|
-
class SubmoduleProxy:
|
|
36
|
-
def __getattr__(self, name):
|
|
37
|
-
return importlib.import_module(f"{NEW_PACKAGE}.{name}")
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
# Add submodule handling to the proxy module
|
|
41
|
-
old_module.__class__ = type(
|
|
42
|
-
"ProxyModuleWithSubmodules", (ProxyModule, SubmoduleProxy), {}
|
|
1
|
+
from . import _experimental as _experimental
|
|
2
|
+
from . import actsave as actsave
|
|
3
|
+
from . import callbacks as callbacks
|
|
4
|
+
from . import lr_scheduler as lr_scheduler
|
|
5
|
+
from . import model as model
|
|
6
|
+
from . import nn as nn
|
|
7
|
+
from . import optimizer as optimizer
|
|
8
|
+
from . import snapshot as snapshot
|
|
9
|
+
from . import typecheck as typecheck
|
|
10
|
+
from .actsave import ActLoad as ActLoad
|
|
11
|
+
from .actsave import ActSave as ActSave
|
|
12
|
+
from .config import MISSING as MISSING
|
|
13
|
+
from .config import AllowMissing as AllowMissing
|
|
14
|
+
from .config import Field as Field
|
|
15
|
+
from .config import MissingField as MissingField
|
|
16
|
+
from .config import PrivateAttr as PrivateAttr
|
|
17
|
+
from .config import TypedConfig as TypedConfig
|
|
18
|
+
from .data import dataset_transform as dataset_transform
|
|
19
|
+
from .log import init_python_logging as init_python_logging
|
|
20
|
+
from .log import lovely as lovely
|
|
21
|
+
from .log import pretty as pretty
|
|
22
|
+
from .lr_scheduler import LRSchedulerConfig as LRSchedulerConfig
|
|
23
|
+
from .model import ActSaveConfig as ActSaveConfig
|
|
24
|
+
from .model import Base as Base
|
|
25
|
+
from .model import BaseConfig as BaseConfig
|
|
26
|
+
from .model import BaseLoggerConfig as BaseLoggerConfig
|
|
27
|
+
from .model import BaseProfilerConfig as BaseProfilerConfig
|
|
28
|
+
from .model import CheckpointLoadingConfig as CheckpointLoadingConfig
|
|
29
|
+
from .model import CheckpointSavingConfig as CheckpointSavingConfig
|
|
30
|
+
from .model import ConfigList as ConfigList
|
|
31
|
+
from .model import DirectoryConfig as DirectoryConfig
|
|
32
|
+
from .model import (
|
|
33
|
+
EnvironmentClassInformationConfig as EnvironmentClassInformationConfig,
|
|
43
34
|
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
from .model import EnvironmentConfig as EnvironmentConfig
|
|
36
|
+
from .model import (
|
|
37
|
+
EnvironmentLinuxEnvironmentConfig as EnvironmentLinuxEnvironmentConfig,
|
|
38
|
+
)
|
|
39
|
+
from .model import (
|
|
40
|
+
EnvironmentSLURMInformationConfig as EnvironmentSLURMInformationConfig,
|
|
41
|
+
)
|
|
42
|
+
from .model import GradientClippingConfig as GradientClippingConfig
|
|
43
|
+
from .model import LightningModuleBase as LightningModuleBase
|
|
44
|
+
from .model import LoggingConfig as LoggingConfig
|
|
45
|
+
from .model import MetricConfig as MetricConfig
|
|
46
|
+
from .model import OptimizationConfig as OptimizationConfig
|
|
47
|
+
from .model import PrimaryMetricConfig as PrimaryMetricConfig
|
|
48
|
+
from .model import ReproducibilityConfig as ReproducibilityConfig
|
|
49
|
+
from .model import SanityCheckingConfig as SanityCheckingConfig
|
|
50
|
+
from .model import TrainerConfig as TrainerConfig
|
|
51
|
+
from .model import WandbWatchConfig as WandbWatchConfig
|
|
52
|
+
from .nn import TypedModuleDict as TypedModuleDict
|
|
53
|
+
from .nn import TypedModuleList as TypedModuleList
|
|
54
|
+
from .optimizer import OptimizerConfig as OptimizerConfig
|
|
55
|
+
from .runner import Runner as Runner
|
|
56
|
+
from .runner import SnapshotConfig as SnapshotConfig
|
|
57
|
+
from .snoop import snoop as snoop
|
|
58
|
+
from .trainer import Trainer as Trainer
|
nshtrainer/ll/actsave.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from nshtrainer.callbacks import * # noqa: F403
|
nshtrainer/ll/config.py
ADDED
nshtrainer/ll/data.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from nshtrainer.data import * # noqa: F403
|
nshtrainer/ll/log.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from nshtrainer.lr_scheduler import * # noqa: F403
|
nshtrainer/ll/model.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from nshtrainer.model import * # noqa: F403
|
nshtrainer/ll/nn.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from nshtrainer.nn import * # noqa: F403
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from nshtrainer.optimizer import * # noqa: F403
|
nshtrainer/ll/runner.py
ADDED
nshtrainer/ll/snoop.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from nshutils import snoop as snoop
|
nshtrainer/ll/trainer.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from nshtrainer.trainer import * # noqa: F403
|
nshtrainer/ll/util.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from nshtrainer.util import * # noqa: F403
|
|
@@ -38,7 +38,7 @@ class ReduceLROnPlateauConfig(LRSchedulerConfigBase):
|
|
|
38
38
|
threshold: float = 1.0e-4
|
|
39
39
|
r"""Threshold for measuring the new optimum, to only focus on significant changes."""
|
|
40
40
|
|
|
41
|
-
threshold_mode:
|
|
41
|
+
threshold_mode: Literal["rel", "abs"] = "rel"
|
|
42
42
|
r"""One of `rel`, `abs`. In `rel` mode, dynamic_threshold = best * (1 + threshold) in 'max' mode or best * (1 - threshold) in `min` mode. In `abs` mode, dynamic_threshold = best + threshold in `max` mode or best - threshold in `min` mode. Default: 'rel'."""
|
|
43
43
|
|
|
44
44
|
@override
|
nshtrainer/model/base.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: nshtrainer
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.8.1
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Nima Shoghi
|
|
6
6
|
Author-email: nimashoghi@gmail.com
|
|
@@ -10,14 +10,11 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
12
|
Requires-Dist: lightning
|
|
13
|
-
Requires-Dist:
|
|
14
|
-
Requires-Dist:
|
|
15
|
-
Requires-Dist:
|
|
16
|
-
Requires-Dist: nshrunner (>=0,<1)
|
|
17
|
-
Requires-Dist: nshutils (>=0,<1)
|
|
13
|
+
Requires-Dist: nshconfig
|
|
14
|
+
Requires-Dist: nshrunner
|
|
15
|
+
Requires-Dist: nshutils
|
|
18
16
|
Requires-Dist: numpy
|
|
19
17
|
Requires-Dist: pytorch-lightning
|
|
20
|
-
Requires-Dist: rich
|
|
21
18
|
Requires-Dist: torch
|
|
22
19
|
Requires-Dist: torchmetrics
|
|
23
20
|
Requires-Dist: typing-extensions
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
nshtrainer/__init__.py,sha256=
|
|
1
|
+
nshtrainer/__init__.py,sha256=Sl5pD2mDTqPh4lE_xJyhTqkStI3cZE-rH5i_vBMHTWc,2136
|
|
2
2
|
nshtrainer/_experimental/__init__.py,sha256=2tQIcrWT8U8no_AeBTYnozaTmxN40kuAJdGQ4b-PoWM,120
|
|
3
3
|
nshtrainer/_experimental/flops/__init__.py,sha256=edo9Ez3LlrnxkNRX9W6YBhPkRPKYGLpkpnl5gx7sEX8,1550
|
|
4
4
|
nshtrainer/_experimental/flops/flop_counter.py,sha256=-sL0Fy6poXa__hyzUMdZScjPULp4coQELQpPU6p6dXU,25736
|
|
5
5
|
nshtrainer/_experimental/flops/module_tracker.py,sha256=bUL-IRTd0aF_DwmXkZjHZAA31p4ZEhyqhc26XWKQUUY,4922
|
|
6
|
-
nshtrainer/_snoop.py,sha256=2rEemPyMP3aIo2QgPzo_-AlT1oXGWYQipId4RQskMls,58
|
|
7
6
|
nshtrainer/actsave/__init__.py,sha256=_ZuwgRtF1-ekouXNvtZCAS1g_IDYGB4NX8BFSGNGBT8,119
|
|
8
7
|
nshtrainer/actsave/_callback.py,sha256=mnHOtuG9vtHEzz9q4vCvDNC6VvjZsgb4MSSuOoUDh3M,2778
|
|
9
8
|
nshtrainer/callbacks/__init__.py,sha256=I6W33ityL9Ko8jjqHh3WH_8miV59SAe9LxInhoqX5XE,1665
|
|
@@ -22,17 +21,30 @@ nshtrainer/callbacks/print_table.py,sha256=FcA-CBWwMf9c1NNRinvYpZC400RNQxuP28bJf
|
|
|
22
21
|
nshtrainer/callbacks/throughput_monitor.py,sha256=YQLdpX3LGybIiD814yT9yCCVSEXRWf8WwsvVaN5aDBE,1848
|
|
23
22
|
nshtrainer/callbacks/timer.py,sha256=sDXPPcdDKu5xnuK_bjr8plIq9MBuluNJ42Mt9LvPZzc,4610
|
|
24
23
|
nshtrainer/callbacks/wandb_watch.py,sha256=pUpMsNxd03ex1rzOmFw2HzGOXjnQGaH84m8cc2dXo4g,2937
|
|
25
|
-
nshtrainer/config.py,sha256=IXOAl_JWFNX9kPTo_iw4Nc3qXqkKrbA6-ZrvTAjqu6A,104
|
|
26
24
|
nshtrainer/data/__init__.py,sha256=7mk1tr7SWUZ7ySbsf0y0ZPszk7u4QznPhQ-7wnpH9ec,149
|
|
27
25
|
nshtrainer/data/balanced_batch_sampler.py,sha256=bcJBcQjh1hB1yKF_xSlT9AtEWv0BJjYc1CuH2BF-ea8,4392
|
|
28
26
|
nshtrainer/data/transform.py,sha256=JeGxvytQly8hougrsdMmKG8gJ6qvFPDglJCO4Tp6STk,1795
|
|
29
|
-
nshtrainer/ll/__init__.py,sha256=
|
|
27
|
+
nshtrainer/ll/__init__.py,sha256=qraZm_bAvoLR69w5iiAic9-TT4sR0g_iKnttiXbb5y0,2658
|
|
28
|
+
nshtrainer/ll/actsave.py,sha256=QJ7yJIqvabpZzumX7PLPzkh6dfqY-zxiEdzv48VtZEY,123
|
|
29
|
+
nshtrainer/ll/callbacks.py,sha256=AxyUmc8aGRSjx6WwwgXYCmdJ73rwLuEAEH0AGRosojQ,49
|
|
30
|
+
nshtrainer/ll/config.py,sha256=fKumJf42HY2FITX1QUM1OTXkYD6U2np2ciyd4PFRPZ8,145
|
|
31
|
+
nshtrainer/ll/data.py,sha256=zRG0FRje-jtSHximVzkHIHzpwsyQxpHCoACFihNKLPM,44
|
|
32
|
+
nshtrainer/ll/log.py,sha256=d4BB3TyM8imK65EXOiOeUTF0zFM1ropbe7Vq3DeB0xU,140
|
|
33
|
+
nshtrainer/ll/lr_scheduler.py,sha256=7xjhN6L69BCUzFhcy33NtMtPuCzHiB611zVWFg92lQ0,52
|
|
34
|
+
nshtrainer/ll/model.py,sha256=6I9gQjEFT2Veer-UmcPy05Pt3mnvaxYX1b3sOdaF96A,45
|
|
35
|
+
nshtrainer/ll/nn.py,sha256=8qiRDFwojIxkB7-LtNWk4mLL2tJbaskHYofDsOIHiNg,42
|
|
36
|
+
nshtrainer/ll/optimizer.py,sha256=3T-VZtT73jVvwCNJGDjgGEbzs-1LFTzMQH-SB_58mSo,49
|
|
37
|
+
nshtrainer/ll/runner.py,sha256=B0m5VEhNKIjF1aFmqPkonkQxDoRL2jeHZGsV3zwhSVE,117
|
|
38
|
+
nshtrainer/ll/snoop.py,sha256=hG9VCdm8mIZytHLZgUKRSoWqg55rVvUpBAH-OSiwgvI,36
|
|
39
|
+
nshtrainer/ll/trainer.py,sha256=hkn2xPtrSPQ7LqQhbyAKuMfNyHdhqB9bDPvgRCK8oJM,47
|
|
40
|
+
nshtrainer/ll/typecheck.py,sha256=ryV1Tzcf7hJ4I19H1oQVkikU9spmRk8jyIKQZ5UF7pQ,62
|
|
41
|
+
nshtrainer/ll/util.py,sha256=PQGu5Ff1raizxjXdm2rFFu4Mo816dBIYmItjkJX1_qk,44
|
|
30
42
|
nshtrainer/lr_scheduler/__init__.py,sha256=uEvgaFAs-4s_bAEMaildy0GT6OvgpgOEKTuzqutESHE,736
|
|
31
43
|
nshtrainer/lr_scheduler/_base.py,sha256=7xOIuxQ86YHbFWG5a3gX46emQj1WN_LaY4-i0Q1TDBg,3659
|
|
32
44
|
nshtrainer/lr_scheduler/linear_warmup_cosine.py,sha256=mn6cyizyI_stkXtg6zxIEGF9btIxMRWigUHUTlUYCSw,5221
|
|
33
|
-
nshtrainer/lr_scheduler/reduce_lr_on_plateau.py,sha256=
|
|
45
|
+
nshtrainer/lr_scheduler/reduce_lr_on_plateau.py,sha256=h76oTHYpMxauV_l6lviya5DW-WKArwxxf7ZQizhmbCw,2782
|
|
34
46
|
nshtrainer/model/__init__.py,sha256=y32Hla-5whpzLL2BtCJpBakSp8o-1nQbpO0j_-xq_Po,1864
|
|
35
|
-
nshtrainer/model/base.py,sha256=
|
|
47
|
+
nshtrainer/model/base.py,sha256=k2Qk_rH4FsBOib2PISXnG97SBlgeD1w_jw02NE4zEQI,21460
|
|
36
48
|
nshtrainer/model/config.py,sha256=6lATW6-Z1SIDgQ1IWrGBVQKTr8DhL5b_rFbJHQz0d5o,66796
|
|
37
49
|
nshtrainer/model/modules/callback.py,sha256=JF59U9-CjJsAIspEhTJbVaGN0wGctZG7UquE3IS7R8A,6408
|
|
38
50
|
nshtrainer/model/modules/debug.py,sha256=DTVty8cKnzj1GCULRyGx_sWTTsq9NLi30dzqjRTnuCU,1127
|
|
@@ -53,12 +65,11 @@ nshtrainer/scripts/find_packages.py,sha256=FbdlfmAefttFSMfaT0A46a-oHLP_ioaQKihwB
|
|
|
53
65
|
nshtrainer/trainer/__init__.py,sha256=P2rmr8oBVTHk-HJHYPcUwWqDEArMbPR4_rPpATbWK3E,40
|
|
54
66
|
nshtrainer/trainer/signal_connector.py,sha256=QAoPM_C5JJOVQebcrJOimUUD3GHyoeZUqCEAvzZlT4U,8710
|
|
55
67
|
nshtrainer/trainer/trainer.py,sha256=eYEYfY9v70MuorHcSf8nqM7f2CkmUHhpPcjCk4FJD7k,14034
|
|
56
|
-
nshtrainer/typecheck.py,sha256=ryV1Tzcf7hJ4I19H1oQVkikU9spmRk8jyIKQZ5UF7pQ,62
|
|
57
68
|
nshtrainer/util/environment.py,sha256=_SEtiQ_s5bL5pllUlf96AOUv15kNvCPvocVC13S7mIk,4166
|
|
58
69
|
nshtrainer/util/seed.py,sha256=HEXgVs-wldByahOysKwq7506OHxdYTEgmP-tDQVAEkQ,287
|
|
59
70
|
nshtrainer/util/slurm.py,sha256=rofIU26z3SdL79SF45tNez6juou1cyDLz07oXEZb9Hg,1566
|
|
60
71
|
nshtrainer/util/typed.py,sha256=NGuDkDzFlc1fAoaXjOFZVbmj0mRFjsQi1E_hPa7Bn5U,128
|
|
61
72
|
nshtrainer/util/typing_utils.py,sha256=8ptjSSLZxlmy4FY6lzzkoGoF5fGNClo8-B_c0XHQaNU,385
|
|
62
|
-
nshtrainer-0.
|
|
63
|
-
nshtrainer-0.
|
|
64
|
-
nshtrainer-0.
|
|
73
|
+
nshtrainer-0.8.1.dist-info/METADATA,sha256=_uS2pF8uKS0wtS3Huc0zaLyVJnOPvy6m_8jaP-ucTzg,647
|
|
74
|
+
nshtrainer-0.8.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
75
|
+
nshtrainer-0.8.1.dist-info/RECORD,,
|
nshtrainer/_snoop.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
from nshutils.snoop import * # type: ignore # noqa: F403
|
nshtrainer/config.py
DELETED
|
File without changes
|
|
File without changes
|