nshtrainer 0.5.1__py3-none-any.whl → 0.5.3__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/ll/__init__.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import importlib
2
2
  import sys
3
3
  from types import ModuleType
4
+ from typing import TYPE_CHECKING
4
5
 
5
6
  # The name of your new package
6
7
  NEW_PACKAGE = "nshtrainer"
@@ -40,3 +41,6 @@ class SubmoduleProxy:
40
41
  old_module.__class__ = type(
41
42
  "ProxyModuleWithSubmodules", (ProxyModule, SubmoduleProxy), {}
42
43
  )
44
+
45
+ if TYPE_CHECKING:
46
+ from nshtrainer import * # noqa: F401, F403
nshtrainer/runner.py CHANGED
@@ -1,9 +1,9 @@
1
1
  import copy
2
2
  import functools
3
- from collections.abc import Mapping, Sequence
3
+ from collections.abc import Callable, Iterable, Mapping, Sequence
4
4
  from typing import Generic
5
5
 
6
- from nshrunner import RunInfo, RunList, TransformFn
6
+ from nshrunner import RunInfo
7
7
  from nshrunner import Runner as _Runner
8
8
  from nshrunner.snapshot import SnapshotArgType
9
9
  from typing_extensions import TypeVar, TypeVarTuple, Unpack, override
@@ -46,11 +46,14 @@ class Runner(
46
46
 
47
47
  def fast_dev_run(
48
48
  self,
49
- runs: RunList[TConfig, Unpack[TArguments]],
49
+ runs: Iterable[tuple[TConfig, Unpack[TArguments]]],
50
50
  n_batches: int = 1,
51
51
  *,
52
52
  env: Mapping[str, str] | None = None,
53
- transforms: list[TransformFn[TConfig, Unpack[TArguments]]] | None = None,
53
+ transforms: list[
54
+ Callable[[TConfig, Unpack[TArguments]], tuple[TConfig, Unpack[TArguments]]]
55
+ ]
56
+ | None = None,
54
57
  ):
55
58
  transforms = transforms or []
56
59
  transforms.append(
@@ -64,11 +67,14 @@ class Runner(
64
67
 
65
68
  def fast_dev_run_generator(
66
69
  self,
67
- runs: RunList[TConfig, Unpack[TArguments]],
70
+ runs: Iterable[tuple[TConfig, Unpack[TArguments]]],
68
71
  n_batches: int = 1,
69
72
  *,
70
73
  env: Mapping[str, str] | None = None,
71
- transforms: list[TransformFn[TConfig, Unpack[TArguments]]] | None = None,
74
+ transforms: list[
75
+ Callable[[TConfig, Unpack[TArguments]], tuple[TConfig, Unpack[TArguments]]]
76
+ ]
77
+ | None = None,
72
78
  ):
73
79
  transforms = transforms or []
74
80
  transforms.append(
@@ -82,13 +88,16 @@ class Runner(
82
88
 
83
89
  def fast_dev_run_session(
84
90
  self,
85
- runs: RunList[TConfig, Unpack[TArguments]],
91
+ runs: Iterable[tuple[TConfig, Unpack[TArguments]]],
86
92
  n_batches: int = 1,
87
93
  *,
88
94
  snapshot: SnapshotArgType,
89
95
  setup_commands: Sequence[str] | None = None,
90
96
  env: Mapping[str, str] | None = None,
91
- transforms: list[TransformFn[TConfig, Unpack[TArguments]]] | None = None,
97
+ transforms: list[
98
+ Callable[[TConfig, Unpack[TArguments]], tuple[TConfig, Unpack[TArguments]]]
99
+ ]
100
+ | None = None,
92
101
  activate_venv: bool = True,
93
102
  session_name: str = "nshrunner",
94
103
  attach: bool = True,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nshtrainer
3
- Version: 0.5.1
3
+ Version: 0.5.3
4
4
  Summary:
5
5
  Author: Nima Shoghi
6
6
  Author-email: nimashoghi@gmail.com
@@ -26,7 +26,7 @@ nshtrainer/config.py,sha256=IXOAl_JWFNX9kPTo_iw4Nc3qXqkKrbA6-ZrvTAjqu6A,104
26
26
  nshtrainer/data/__init__.py,sha256=7mk1tr7SWUZ7ySbsf0y0ZPszk7u4QznPhQ-7wnpH9ec,149
27
27
  nshtrainer/data/balanced_batch_sampler.py,sha256=bcJBcQjh1hB1yKF_xSlT9AtEWv0BJjYc1CuH2BF-ea8,4392
28
28
  nshtrainer/data/transform.py,sha256=JeGxvytQly8hougrsdMmKG8gJ6qvFPDglJCO4Tp6STk,1795
29
- nshtrainer/ll/__init__.py,sha256=1cccXGP085GSR5AYM4zVg4CgTso9rgzrPJ_mZz0RRJ0,1027
29
+ nshtrainer/ll/__init__.py,sha256=u3wEyfc8kIsdRwZ8jpmywkEykHX4iIa-xA4we9GSuYE,1128
30
30
  nshtrainer/lr_scheduler/__init__.py,sha256=uEvgaFAs-4s_bAEMaildy0GT6OvgpgOEKTuzqutESHE,736
31
31
  nshtrainer/lr_scheduler/_base.py,sha256=7xOIuxQ86YHbFWG5a3gX46emQj1WN_LaY4-i0Q1TDBg,3659
32
32
  nshtrainer/lr_scheduler/linear_warmup_cosine.py,sha256=mn6cyizyI_stkXtg6zxIEGF9btIxMRWigUHUTlUYCSw,5221
@@ -47,7 +47,7 @@ nshtrainer/nn/module_dict.py,sha256=NOY0B6WDTnktyWH4GthsprMQo0bpehC-hCq9SfD8paE,
47
47
  nshtrainer/nn/module_list.py,sha256=fb2u5Rqdjff8Pekyr9hkCPkBorQ-fldzzFAjsgWAm30,1719
48
48
  nshtrainer/nn/nonlinearity.py,sha256=owtU4kh4G98psD0axOJWVfBhm-OtJVgFM-TXSHmbNPU,3625
49
49
  nshtrainer/optimizer.py,sha256=kuJEA1pvB3y1FcsfhAoOJujVqEZqFHlmYO8GW6JeA1g,1527
50
- nshtrainer/runner.py,sha256=lBTx7eccoHezRie2GNh9iIJNnjPDV3bsH26wgKQQTqk,3554
50
+ nshtrainer/runner.py,sha256=7EumpnBkdNWjSNT9Gm-pkxAJ3W6-iMC-yae-WNeZcLw,3771
51
51
  nshtrainer/scripts/check_env.py,sha256=IMl6dSqsLYppI0XuCsVq8lK4bYqXwY9KHJkzsShz4Kg,806
52
52
  nshtrainer/scripts/find_packages.py,sha256=FbdlfmAefttFSMfaT0A46a-oHLP_ioaQKihwBfBeWeA,1467
53
53
  nshtrainer/trainer/__init__.py,sha256=P2rmr8oBVTHk-HJHYPcUwWqDEArMbPR4_rPpATbWK3E,40
@@ -59,6 +59,6 @@ nshtrainer/util/seed.py,sha256=HEXgVs-wldByahOysKwq7506OHxdYTEgmP-tDQVAEkQ,287
59
59
  nshtrainer/util/slurm.py,sha256=rofIU26z3SdL79SF45tNez6juou1cyDLz07oXEZb9Hg,1566
60
60
  nshtrainer/util/typed.py,sha256=NGuDkDzFlc1fAoaXjOFZVbmj0mRFjsQi1E_hPa7Bn5U,128
61
61
  nshtrainer/util/typing_utils.py,sha256=8ptjSSLZxlmy4FY6lzzkoGoF5fGNClo8-B_c0XHQaNU,385
62
- nshtrainer-0.5.1.dist-info/METADATA,sha256=ajSyujR9GqfArDI-JfMem74Qae_mQTJpR1quQ2MD4pk,812
63
- nshtrainer-0.5.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
64
- nshtrainer-0.5.1.dist-info/RECORD,,
62
+ nshtrainer-0.5.3.dist-info/METADATA,sha256=WbSdHGLe7sAKHKZWi5C7KjG-MwmWbcxTiNL67yqTwFs,812
63
+ nshtrainer-0.5.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
64
+ nshtrainer-0.5.3.dist-info/RECORD,,