netloader 3.11.2__tar.gz → 3.11.3__tar.gz
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.
- {netloader-3.11.2 → netloader-3.11.3}/PKG-INFO +1 -1
- {netloader-3.11.2 → netloader-3.11.3}/netloader/__init__.py +1 -1
- {netloader-3.11.2 → netloader-3.11.3}/netloader/architectures/base.py +2 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/architectures/encoder_decoder.py +15 -1
- {netloader-3.11.2 → netloader-3.11.3}/netloader/architectures/flows.py +13 -5
- {netloader-3.11.2 → netloader-3.11.3}/netloader/models/misc.py +1 -1
- {netloader-3.11.2 → netloader-3.11.3}/netloader/network.py +23 -1
- {netloader-3.11.2 → netloader-3.11.3}/netloader.egg-info/PKG-INFO +1 -1
- {netloader-3.11.2 → netloader-3.11.3}/LICENSE.txt +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/README.md +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/architectures/__init__.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/architectures/utils.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/data.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/layers/__init__.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/layers/base.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/layers/blocks.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/layers/convolutional.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/layers/flows.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/layers/linear.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/layers/misc.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/layers/multi_layer.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/layers/pooling.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/layers/recurrent.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/layers/utils.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/loss_funcs.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/models/__init__.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/models/convnext.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/networks/__init__.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/schedulers.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/transforms.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/utils/__init__.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/utils/configs.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/utils/transforms.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/utils/types.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader/utils/utils.py +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader.egg-info/SOURCES.txt +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader.egg-info/dependency_links.txt +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader.egg-info/requires.txt +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/netloader.egg-info/top_level.txt +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/pyproject.toml +0 -0
- {netloader-3.11.2 → netloader-3.11.3}/setup.cfg +0 -0
|
@@ -6,7 +6,7 @@ import logging
|
|
|
6
6
|
import warnings
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
__version__ = '3.11.
|
|
9
|
+
__version__ = '3.11.3'
|
|
10
10
|
__author__ = 'Ethan Tregidga'
|
|
11
11
|
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.WARNING)
|
|
12
12
|
warnings.filterwarnings('once', category=DeprecationWarning, module=r'^netloader(\.|$)')
|
|
@@ -62,6 +62,8 @@ class BaseArchitecture(UtilityMixin, ABC, Generic[LossCT, TensorLossCT]):
|
|
|
62
62
|
Architecture optimiser
|
|
63
63
|
scheduler : LRScheduler
|
|
64
64
|
Optimiser scheduler
|
|
65
|
+
run : Run | None
|
|
66
|
+
Weights & Biases run object for logging and tracking experiments
|
|
65
67
|
net : BaseNetwork
|
|
66
68
|
Neural network
|
|
67
69
|
"""
|
|
@@ -27,7 +27,7 @@ class BaseEncoder(BaseArchitecture):
|
|
|
27
27
|
description : str
|
|
28
28
|
Description of the architecture
|
|
29
29
|
version : str
|
|
30
|
-
Version of the architecture
|
|
30
|
+
Version of the architecture when it was created or re-saved
|
|
31
31
|
losses : tuple[list[LossCT], list[LossCT]]
|
|
32
32
|
Architecture training and validation losses as a float or dictionary of losses for each loss
|
|
33
33
|
function
|
|
@@ -42,6 +42,8 @@ class BaseEncoder(BaseArchitecture):
|
|
|
42
42
|
Architecture optimiser
|
|
43
43
|
scheduler : LRScheduler
|
|
44
44
|
Optimiser scheduler
|
|
45
|
+
run : Run | None
|
|
46
|
+
Weights & Biases run object for logging and tracking experiments
|
|
45
47
|
net : BaseNetwork
|
|
46
48
|
Neural network
|
|
47
49
|
"""
|
|
@@ -211,6 +213,8 @@ class Autoencoder(BaseArchitecture):
|
|
|
211
213
|
----------
|
|
212
214
|
description : str
|
|
213
215
|
Description of the architecture
|
|
216
|
+
version : str
|
|
217
|
+
Version of the architecture when it was created or re-saved
|
|
214
218
|
losses : tuple[list[LossCT], list[LossCT]]
|
|
215
219
|
Architecture training and validation losses as a float or dictionary of losses for each loss
|
|
216
220
|
function
|
|
@@ -223,6 +227,8 @@ class Autoencoder(BaseArchitecture):
|
|
|
223
227
|
Architecture optimiser
|
|
224
228
|
scheduler : LRScheduler
|
|
225
229
|
Optimiser scheduler
|
|
230
|
+
run : Run | None
|
|
231
|
+
Weights & Biases run object for logging and tracking experiments
|
|
226
232
|
net : BaseNetwork
|
|
227
233
|
Neural network
|
|
228
234
|
reconstruct_func : BaseLoss
|
|
@@ -427,6 +433,8 @@ class Decoder(BaseArchitecture):
|
|
|
427
433
|
----------
|
|
428
434
|
description : str
|
|
429
435
|
Description of the architecture
|
|
436
|
+
version : str
|
|
437
|
+
Version of the architecture when it was created or re-saved
|
|
430
438
|
losses : tuple[list[LossCT], list[LossCT]]
|
|
431
439
|
Architecture training and validation losses as a float or dictionary of losses for each loss
|
|
432
440
|
function
|
|
@@ -441,6 +449,8 @@ class Decoder(BaseArchitecture):
|
|
|
441
449
|
Architecture optimiser
|
|
442
450
|
scheduler : LRScheduler
|
|
443
451
|
Optimiser scheduler
|
|
452
|
+
run : Run | None
|
|
453
|
+
Weights & Biases run object for logging and tracking experiments
|
|
444
454
|
net : BaseNetwork
|
|
445
455
|
Neural network
|
|
446
456
|
"""
|
|
@@ -587,6 +597,8 @@ class Encoder(BaseEncoder):
|
|
|
587
597
|
----------
|
|
588
598
|
description : str
|
|
589
599
|
Description of the architecture
|
|
600
|
+
version : str
|
|
601
|
+
Version of the architecture when it was created or re-saved
|
|
590
602
|
losses : tuple[list[LossCT], list[LossCT]]
|
|
591
603
|
Architecture training and validation losses as a float or dictionary of losses for each loss
|
|
592
604
|
function
|
|
@@ -601,6 +613,8 @@ class Encoder(BaseEncoder):
|
|
|
601
613
|
Architecture optimiser
|
|
602
614
|
scheduler : LRScheduler
|
|
603
615
|
Optimiser scheduler
|
|
616
|
+
run : Run | None
|
|
617
|
+
Weights & Biases run object for logging and tracking experiments
|
|
604
618
|
net : BaseNetwork
|
|
605
619
|
Neural network
|
|
606
620
|
"""
|
|
@@ -14,8 +14,8 @@ from zuko.distributions import NormalizingFlow
|
|
|
14
14
|
from netloader.data import Data
|
|
15
15
|
from netloader.utils import label_change
|
|
16
16
|
from netloader.loss_funcs import BaseLoss
|
|
17
|
-
from netloader.network import BaseNetwork
|
|
18
17
|
from netloader.transforms import BaseTransform
|
|
18
|
+
from netloader.network import BaseNetwork, Network
|
|
19
19
|
from netloader.architectures.base import BaseArchitecture
|
|
20
20
|
from netloader.architectures.encoder_decoder import BaseEncoder
|
|
21
21
|
from netloader.utils.types import NDArrayLike, TensorListLike, NDArrayListLike, TensorT
|
|
@@ -29,10 +29,10 @@ class NormFlow(BaseArchitecture):
|
|
|
29
29
|
|
|
30
30
|
Attributes
|
|
31
31
|
----------
|
|
32
|
-
net : BaseNetwork
|
|
33
|
-
Neural spline flow
|
|
34
32
|
description : str
|
|
35
33
|
Description of the architecture
|
|
34
|
+
version : str
|
|
35
|
+
Version of the architecture when it was created or re-saved
|
|
36
36
|
losses : tuple[list[LossCT], list[LossCT]]
|
|
37
37
|
Architecture training and validation losses as a float or dictionary of losses for each loss
|
|
38
38
|
function
|
|
@@ -45,6 +45,10 @@ class NormFlow(BaseArchitecture):
|
|
|
45
45
|
Architecture optimiser
|
|
46
46
|
scheduler : LRScheduler
|
|
47
47
|
Optimiser scheduler
|
|
48
|
+
run : Run | None
|
|
49
|
+
Weights & Biases run object for logging and tracking experiments
|
|
50
|
+
net : BaseNetwork
|
|
51
|
+
Neural spline flow
|
|
48
52
|
"""
|
|
49
53
|
@staticmethod
|
|
50
54
|
def _data_loader_translation(low_dim: TensorT, high_dim: TensorT) -> tuple[TensorT, TensorT]:
|
|
@@ -132,6 +136,8 @@ class NormFlowEncoder(BaseEncoder):
|
|
|
132
136
|
----------
|
|
133
137
|
description : str
|
|
134
138
|
Description of the architecture
|
|
139
|
+
version : str
|
|
140
|
+
Version of the architecture when it was created or re-saved
|
|
135
141
|
losses : tuple[list[LossCT], list[LossCT]]
|
|
136
142
|
Architecture training and validation losses as a float or dictionary of losses for each loss
|
|
137
143
|
function
|
|
@@ -146,6 +152,8 @@ class NormFlowEncoder(BaseEncoder):
|
|
|
146
152
|
Architecture optimiser
|
|
147
153
|
scheduler : LRScheduler
|
|
148
154
|
Optimiser scheduler
|
|
155
|
+
run : Run | None
|
|
156
|
+
Weights & Biases run object for logging and tracking experiments
|
|
149
157
|
net : BaseNetwork
|
|
150
158
|
Neural network
|
|
151
159
|
"""
|
|
@@ -222,7 +230,7 @@ class NormFlowEncoder(BaseEncoder):
|
|
|
222
230
|
net,
|
|
223
231
|
overwrite=overwrite,
|
|
224
232
|
mix_precision=mix_precision,
|
|
225
|
-
learning_rate=0
|
|
233
|
+
learning_rate=0.,
|
|
226
234
|
description=description,
|
|
227
235
|
verbose=verbose,
|
|
228
236
|
classes=classes,
|
|
@@ -243,7 +251,7 @@ class NormFlowEncoder(BaseEncoder):
|
|
|
243
251
|
'max': transform,
|
|
244
252
|
'meds': transform,
|
|
245
253
|
}
|
|
246
|
-
assert isinstance(self.net, nn.ModuleList)
|
|
254
|
+
assert isinstance(self.net, (nn.ModuleList, Network))
|
|
247
255
|
|
|
248
256
|
if not self._train_encoder:
|
|
249
257
|
self.net.layers[:-1].requires_grad_(False)
|
|
@@ -183,7 +183,7 @@ class MultiNetwork(BaseNetwork[TypedModuleList[CompatibleNetwork | Network]]):
|
|
|
183
183
|
def __setstate__(self, state: dict[str, Any]) -> None:
|
|
184
184
|
super().__setstate__(state)
|
|
185
185
|
self._cache = state.get('save_outputs', False)
|
|
186
|
-
self.layers = TypedModuleList(state.get('layers',
|
|
186
|
+
self.layers = TypedModuleList(state.get('layers', state.get('net')))
|
|
187
187
|
|
|
188
188
|
def forward(self, x: TensorListLike) -> TensorListLike:
|
|
189
189
|
"""
|
|
@@ -81,7 +81,7 @@ class BaseNetwork(nn.Module, ABC, Generic[ModuleListT]):
|
|
|
81
81
|
"""
|
|
82
82
|
if item == 'net':
|
|
83
83
|
warn(
|
|
84
|
-
'
|
|
84
|
+
'BaseNetwork.net is deprecated, please use BaseNetwork.layers '
|
|
85
85
|
'instead',
|
|
86
86
|
DeprecationWarning,
|
|
87
87
|
stacklevel=2,
|
|
@@ -100,6 +100,28 @@ class BaseNetwork(nn.Module, ABC, Generic[ModuleListT]):
|
|
|
100
100
|
"""
|
|
101
101
|
return {'name': self.name, 'version': netloader.__version__}
|
|
102
102
|
|
|
103
|
+
def __setattr__(self, key: str, value: Any) -> None:
|
|
104
|
+
"""
|
|
105
|
+
Sets the attribute of the network.
|
|
106
|
+
|
|
107
|
+
Parameters
|
|
108
|
+
----------
|
|
109
|
+
key : str
|
|
110
|
+
Name of the attribute to set
|
|
111
|
+
value : Any
|
|
112
|
+
Value to set the attribute to
|
|
113
|
+
"""
|
|
114
|
+
if key == 'net':
|
|
115
|
+
warn(
|
|
116
|
+
'BaseNetwork.net is deprecated, please use BaseNetwork.layers '
|
|
117
|
+
'instead',
|
|
118
|
+
DeprecationWarning,
|
|
119
|
+
stacklevel=2,
|
|
120
|
+
)
|
|
121
|
+
super().__setattr__('layers', value)
|
|
122
|
+
else:
|
|
123
|
+
super().__setattr__(key, value)
|
|
124
|
+
|
|
103
125
|
def __setstate__(self, state: dict[str, Any]) -> None:
|
|
104
126
|
"""
|
|
105
127
|
Sets the state of the network for pickling
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|