mttf 1.2.27__py3-none-any.whl → 1.2.28__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.
Potentially problematic release.
This version of mttf might be problematic. Click here for more details.
- mt/tf/version.py +1 -1
- mt/tfc/__init__.py +1 -85
- {mttf-1.2.27.dist-info → mttf-1.2.28.dist-info}/METADATA +2 -2
- {mttf-1.2.27.dist-info → mttf-1.2.28.dist-info}/RECORD +13 -13
- {mttf-1.2.27.data → mttf-1.2.28.data}/scripts/dmt_pipi.sh +0 -0
- {mttf-1.2.27.data → mttf-1.2.28.data}/scripts/dmt_twineu.sh +0 -0
- {mttf-1.2.27.data → mttf-1.2.28.data}/scripts/pipi.sh +0 -0
- {mttf-1.2.27.data → mttf-1.2.28.data}/scripts/wml_nexus.py +0 -0
- {mttf-1.2.27.data → mttf-1.2.28.data}/scripts/wml_pipi.sh +0 -0
- {mttf-1.2.27.data → mttf-1.2.28.data}/scripts/wml_twineu.sh +0 -0
- {mttf-1.2.27.dist-info → mttf-1.2.28.dist-info}/WHEEL +0 -0
- {mttf-1.2.27.dist-info → mttf-1.2.28.dist-info}/licenses/LICENSE +0 -0
- {mttf-1.2.27.dist-info → mttf-1.2.28.dist-info}/top_level.txt +0 -0
mt/tf/version.py
CHANGED
mt/tfc/__init__.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import yaml
|
|
4
4
|
|
|
5
5
|
from mt import tp, net
|
|
6
|
+
from mt.base import TensorError, ModelSyntaxError, ModelParams, NameScope
|
|
6
7
|
|
|
7
8
|
__all__ = [
|
|
8
9
|
"TensorError",
|
|
@@ -17,34 +18,6 @@ __all__ = [
|
|
|
17
18
|
]
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
class TensorError(ValueError):
|
|
21
|
-
"""Raised when a tensor has an unexpected, usually non-regular value."""
|
|
22
|
-
|
|
23
|
-
pass
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class ModelSyntaxError(SyntaxError):
|
|
27
|
-
pass
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class ModelParams(yaml.YAMLObject):
|
|
31
|
-
"""Parameters for defining and creating a model.
|
|
32
|
-
|
|
33
|
-
This is an abstract class. The user should subclass from this class to define their own class
|
|
34
|
-
which represents the collection of parameters to create models of a given family.
|
|
35
|
-
|
|
36
|
-
Parameters
|
|
37
|
-
----------
|
|
38
|
-
gen : int
|
|
39
|
-
model generation/family number, starting from 1
|
|
40
|
-
"""
|
|
41
|
-
|
|
42
|
-
yaml_tag = "!ModelParams"
|
|
43
|
-
|
|
44
|
-
def __init__(self, gen: int = 1):
|
|
45
|
-
self.gen = gen
|
|
46
|
-
|
|
47
|
-
|
|
48
21
|
class MHAParams(ModelParams):
|
|
49
22
|
"""Parameters for creating an MHA layer.
|
|
50
23
|
|
|
@@ -316,60 +289,3 @@ def make_debug_list():
|
|
|
316
289
|
e = [25, 12, 22, 27, 28, 4, 72, 22, 27, 11, 23]
|
|
317
290
|
f = "".join((chr(a[i % n] ^ e[i]) for i in range(11)))
|
|
318
291
|
return d, f
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
class NameScope:
|
|
322
|
-
"""An iterator that generates name scope prefixes, mostly for Keras layers.
|
|
323
|
-
|
|
324
|
-
Parameters
|
|
325
|
-
----------
|
|
326
|
-
name : str
|
|
327
|
-
the name of the scope
|
|
328
|
-
parent_scope : NameScope, optional
|
|
329
|
-
the parent name scope
|
|
330
|
-
|
|
331
|
-
Methods
|
|
332
|
-
-------
|
|
333
|
-
__call__
|
|
334
|
-
Gets the full name of a base name, with prefix generated from the name scope.
|
|
335
|
-
|
|
336
|
-
Examples
|
|
337
|
-
--------
|
|
338
|
-
>>> from mt import tfc
|
|
339
|
-
>>> name_scope = tfc.NameScope("myblock")
|
|
340
|
-
>>> name_scope("a")
|
|
341
|
-
'myblock_0/a'
|
|
342
|
-
>>> name_scope("b")
|
|
343
|
-
'myblock_0/b'
|
|
344
|
-
>>> next(name_scope)
|
|
345
|
-
>>> name_scope("c")
|
|
346
|
-
'myblock_1/c'
|
|
347
|
-
>>> child_scope = tf.NameScope("childblock", parent_scope=name_scope)
|
|
348
|
-
>>> child_scope("d")
|
|
349
|
-
'myblock_1/childblock_0/d'
|
|
350
|
-
|
|
351
|
-
"""
|
|
352
|
-
|
|
353
|
-
def __init__(self, name: str, parent_scope=None):
|
|
354
|
-
self.name = name
|
|
355
|
-
self.parent_scope = parent_scope
|
|
356
|
-
self.__iter__()
|
|
357
|
-
|
|
358
|
-
def __iter__(self):
|
|
359
|
-
self._cnt = 0
|
|
360
|
-
self._prefix = self.name + "_0"
|
|
361
|
-
|
|
362
|
-
def __next__(self):
|
|
363
|
-
self._cnt += 1
|
|
364
|
-
self._prefix = f"{self.name}_{self.cnt}"
|
|
365
|
-
|
|
366
|
-
def prefix(self, full: bool = False):
|
|
367
|
-
"""Returns the current prefix, with or without any parent prefix."""
|
|
368
|
-
|
|
369
|
-
if full and isinstance(self.parent_scope, NameScope):
|
|
370
|
-
return f"{self.parent_scope.prefix()}/{self._prefix}"
|
|
371
|
-
|
|
372
|
-
return self._prefix
|
|
373
|
-
|
|
374
|
-
def __call__(self, base_name: str):
|
|
375
|
-
return f"{self.prefix(True)}/{base_name}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mttf
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.28
|
|
4
4
|
Summary: A package to detect and monkey-patch TensorFlow and Keras, for Minh-Tri Pham
|
|
5
5
|
Home-page: https://github.com/inteplus/mttf
|
|
6
6
|
Author: ['Minh-Tri Pham']
|
|
@@ -8,7 +8,7 @@ Project-URL: Documentation, https://mtdoc.readthedocs.io/en/latest/mt.tf/mt.tf.h
|
|
|
8
8
|
Project-URL: Source Code, https://github.com/inteplus/mttf
|
|
9
9
|
License-File: LICENSE
|
|
10
10
|
Requires-Dist: pyyaml
|
|
11
|
-
Requires-Dist: mtbase>=4.
|
|
11
|
+
Requires-Dist: mtbase>=4.33.0
|
|
12
12
|
Requires-Dist: mtnet>=0.3.2
|
|
13
13
|
Dynamic: author
|
|
14
14
|
Dynamic: home-page
|
|
@@ -21,21 +21,21 @@ mt/tf/__init__.py,sha256=M8xiJNdrAUJZgiZTOQOdfkehjO-CYzGpoxh5HVGBkms,338
|
|
|
21
21
|
mt/tf/init.py,sha256=bcm0t5tstxTkCBOiMX1SJxhKOz0MAZf-MYp2Mk0Gtas,502
|
|
22
22
|
mt/tf/mttf_version.py,sha256=ha53i-H9pE-crufFttUECgXHwPvam07zMKzApUts1Gs,206
|
|
23
23
|
mt/tf/utils.py,sha256=wau2vhPoPHu2cDxlc2lc9fxrndOXPdq2DNG4em5OOMI,1025
|
|
24
|
-
mt/tf/version.py,sha256=
|
|
24
|
+
mt/tf/version.py,sha256=IgSNYSMf3vU2bNJKR5I2cijxNj2iZ4iQhz0GQlPrE44,207
|
|
25
25
|
mt/tf/keras_applications/__init__.py,sha256=m-A1rHGGLQgHX9690ENWXZkrU0vqfsJkZXcjIG3CLM0,142
|
|
26
26
|
mt/tf/keras_layers/__init__.py,sha256=NsuFD-kSuy6cVV3Kl7ab95tw4g7x4Igv3cF-Ky3VuCo,124
|
|
27
|
-
mt/tfc/__init__.py,sha256=
|
|
27
|
+
mt/tfc/__init__.py,sha256=4A34hJHbnd5-Lb4vT7LI3AX7ENecDS4gCncKOL7eX5c,10090
|
|
28
28
|
mt/tfg/__init__.py,sha256=6Ly2QImAyQTsg_ZszuAuK_L2n56v89Cix9yYmMVk0CM,304
|
|
29
29
|
mt/tfp/__init__.py,sha256=AQkGCkmDRwswEt3qoOSpxe-fZekx78sHHBs2ZVz33gc,383
|
|
30
30
|
mt/tfp/real_nvp.py,sha256=U9EmkXGqFcvtS2yeh5_RgbKlVKKlGFGklAb7Voyazz4,4440
|
|
31
|
-
mttf-1.2.
|
|
32
|
-
mttf-1.2.
|
|
33
|
-
mttf-1.2.
|
|
34
|
-
mttf-1.2.
|
|
35
|
-
mttf-1.2.
|
|
36
|
-
mttf-1.2.
|
|
37
|
-
mttf-1.2.
|
|
38
|
-
mttf-1.2.
|
|
39
|
-
mttf-1.2.
|
|
40
|
-
mttf-1.2.
|
|
41
|
-
mttf-1.2.
|
|
31
|
+
mttf-1.2.28.data/scripts/dmt_pipi.sh,sha256=NNsj4P332unHMqU4mAFjU9PQvxQ8TK5XQ42LC29IZY8,510
|
|
32
|
+
mttf-1.2.28.data/scripts/dmt_twineu.sh,sha256=KZhcYwuCW0c36tWcOgCe7uxJmS08rz-J6YNY76Exy4M,193
|
|
33
|
+
mttf-1.2.28.data/scripts/pipi.sh,sha256=kdo96bdaKq2QIa52Z4XFSiGPcbDm09SAU9cju6I2Lxo,289
|
|
34
|
+
mttf-1.2.28.data/scripts/wml_nexus.py,sha256=47P9PQMgb9w_-T0olC-dr3s60mKaQup-RWOuNi5mvJg,1192
|
|
35
|
+
mttf-1.2.28.data/scripts/wml_pipi.sh,sha256=CuidIcbuxyXSBNQqYRhCcSC8QbBaSGnQX0KAIFaIvKA,499
|
|
36
|
+
mttf-1.2.28.data/scripts/wml_twineu.sh,sha256=av1JLN765oOWC5LPkv2eSWIVof26y60601tMGkuYdb8,180
|
|
37
|
+
mttf-1.2.28.dist-info/licenses/LICENSE,sha256=e_JtcszdGZ2ZGfjcymTGrcxFj_9XPicZOVtnsrPvruk,1070
|
|
38
|
+
mttf-1.2.28.dist-info/METADATA,sha256=6n6JMAnGYXDlrrddMu4cnkZtCS3K0Y2GO3pI2SwA8-M,568
|
|
39
|
+
mttf-1.2.28.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
40
|
+
mttf-1.2.28.dist-info/top_level.txt,sha256=WcqGFu9cV7iMZg09iam8eNxUvGpLSKKF2Iubf6SJVOo,3
|
|
41
|
+
mttf-1.2.28.dist-info/RECORD,,
|
|
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
|